Several  times we need to display Auto Number or serial number for displaying  records in gridview or other similar controls in ASp.NET.   We can add AutoNumber column by using Container.DataItemIndex  property in html markup of the Gridview.     Here's the sample html markup for the page   < title > Auto Number Cloumn in GridView </ title >  </ head >  < body >  < form  id ="form1"  runat ="server" >  < asp:GridView  ID ="GridView1"  runat ="server"                 AllowPaging ="True"  AutoGenerateColumns ="False"                DataSourceID ="SqlDataSource1"  PageSize ="6"                 AlternatingRowStyle-BackColor ="#006699"                 AlternatingRowStyle-ForeColor ="#FFFFFF"  >      < Columns >      < asp:TemplateField  HeaderText ="Serial Number" >      < ItemTemplate >          <% # Contai...
C#, ASP.NET, .NET, Intermediate,Database,Database,Free source code, tutorials