# How to create a Main Header in Gridview along with the GridView Column Headers?

In this post, I will show you how to add a header in GridView.

You have to manually add a row to the table generated by the GridView follows.

<asp:GridView ID="GridView1" runat="server" AllowPaging="true" PageSize="10"
OnPreRender="GridView1_PreRender"/>

protected void grd_PreRender(object sender, EventArgs e)
{

GridViewRow gv = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableCell tbCell = new TableCell();
tbCell.ColumnSpan = 3;