什麼是C#代碼(代碼後面)添加一列在asp.net到grdview ...一些相同的:添加列ASP.net的GridView使用C#
<asp:BoundField DataField="Last Name"
HeaderText="Last Name"
SortExpression="LastName" />
什麼是C#代碼(代碼後面)添加一列在asp.net到grdview ...一些相同的:添加列ASP.net的GridView使用C#
<asp:BoundField DataField="Last Name"
HeaderText="Last Name"
SortExpression="LastName" />
BoundField boundfield = new BoundField();
boundfield.DataField = "Last Name";
boundfield.HeaderText = "Last Name";
boundfield.SortExpression= "LastName";
GridView1.Columns.Add(boundfield);
東西沿着這些路線:
var column = new BoundField();
column.DataField = "LastName";
column.HeaderText = "Last Name";
column.SortExpression = "LastName";
GridView1.Columns.Add(column);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var boundColumn = new BoundField();
boundColumn.DataField = "LastName";
boundColumn.HeaderText = "Last Name";
boundColumn.SortExpression = "LastName";
GVPictures.Columns.Add(boundColumn);
BindGridView();
}
}