protected void GridView1_DataBound(object sender, EventArgs e)
{
GridViewRow gvr = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableCellCollection tcc = null;
Table t = new Table();
TableRow tr = new TableRow();
TableCell tc = null;
tc = new TableCell();
tc.HorizontalAlign = HorizontalAlign.Center;
tc.Text = "***";
tc.ColumnSpan =3;
tc.BorderWidth =1;
gvr.Cells.Add(tc);
GridView1.HeaderRow.Parent.Controls.AddAt(0, gvr);
}
本文介绍如何在ASP.NET中使用GridView控件自定义表头,通过创建新的GridViewRow对象并设置其属性来实现特定样式的表头显示。
1756

被折叠的 条评论
为什么被折叠?



