How to add a static row to a gridview

 add a static row to a gridview with c#.


Here I  explain how to add a static row to a gridview with c#

protected void grd_Pre(object sender, EventArgs e)
{
    GridViewRow gv = new GridViewRow(0, 0, DataControlRowType.Header,    DataControlRowState.Normal);
    TableCell TC = new TableCell();
    TC.ColumnSpan = 3;
    TC.Text = "Gridview head";er
    TC.Attributes.Add("style", "text-align:right");
    gv.Cells.Add(tc);
    this.GridView1.Controls[0].Controls.AddAt(0, gv);
}



Comments

Popular posts from this blog

Dynamic Mega Menu With Asp.Net with c#,java script and Sql Server.

Bootstrap Modal Popup keep open on PostBack in ASP.Net

Export div content to PDF Using ITextSharp in asp.net