首先,请你将不得不在进入模板列控制列。然后,你可以有你有想要的东西 - 一个表,文本框,复选框等
<HeaderTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text=''></asp:TextBox>
<asp:CheckBox ID="CheckBox1" runat="server" />
</HeaderTemplate>
你就必须在RowDataBound事件的进一步控制:
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType != DataControlRowType.Header)
return;
// let the third column span over the next 2 columns.
e.Row.Cells[2].ColumnSpan = 3;
e.Row.Cells[3].Visible = false;
e.Row.Cells[4].Visible = false;
// could span more than 1 row.
e.Row.Cells[2].RowSpan = 2;
等等
在一起,您可以全面控制标题部分。