Posts

Showing posts with the label Gridview

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); }

Scrollable GridView With Fixed Headers Asp.Net

Scrollable GridView With Fixed Headers Using CSS Example In Asp.Net 2.0,3.5,4.0 C# VB.NET. In this example i am going to show how to create scrollable GridView with fixed headers which don't get scrolled with records and stay on the top in asp.net using  css , I've tested this code on IE7 and Firefox 2.0 , 3.5. For this we need to add css to headers of gridview to keep them on the top. First of all place a  Panel  on the aspx page from toolbox. Set height to 200px and width to 200px and scrollbars to Vertical. Now add a gridview inside this Panel and set the datasource to populate gridview. < form id ="form1" runat ="server" > < div > < asp:Panel ID ="Panel1" runat ="server" Height ="200px" Width ="200px" ScrollBars ="Vertical" > < asp:GridView ID ="GridView1" runat ="server" AutoGenerateColumns ="Fa...