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

Bootstrap Modal Popup keep open on PostBack in ASP.Net

Resolved Issue in Asp core 3.0 serializersettings does not exist in AddJsonOptions

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