Add DataGrid with code on the web page

xiaoxiao2021-03-06  103

/ / You can set the properties of the DataGrid to adjust the location or set the style.

Public DataGrid DataGrid1 = New DataGrid ();

Private Void Page_Load (Object Sender, System.EventArgs E)

{

DataGrid1 .autogeneratecolumns = true;

DataGrid1 .datasource = DATATABLE1.DEFAULTVIEW;

DataGrid1 .databind ();

Page.Controls [1] .controls.add (datagrid1);

}

转载请注明原文地址:https://www.9cbs.com/read-97365.html

New Post(0)