更新时间:2021-07-10 02:54:09
创建gridview并设置 AutoGenerateColumns =true
并将数据表绑定到它。
Create a gridview and set the property ofAutoGenerateColumns="true"
and bind the datatable to it.
<asp:GridView runat="server" ID="gridViewName" AutoGenerateColumns="true"></asp:GridView>
gridViewName.DataSource = yourDataTable;
gridViewName.DataBind();
您好,请参阅以下链接,
1.
Hi, refer below links,
1.
Control.DataBind Method ()
[ ^ ]
2. GridView.DataBind方法(System.Web.UI.WebControls) [ ^ ]