Flicker Images

Find programmers and grapic design experts at ScriptLance.com

Thursday, September 27, 2012

How to Add Auto Number Column in Asp.net GridView

While working in ASP.NET, you often come across a need to display serial number or Auto-number in a Gridview control. This can be accomplished by adding the Container.DataItemIndex  in the html markup of the Gridview control.

<asp:TemplateField>
     <ItemTemplate>
 <%# Container.DataItemIndex + 1 %>
     </ItemTemplate>
 </asp:TemplateField>
Share:

0 comments:

Post a Comment

Game Reviews

BTemplates.com

Powered by Blogger.

Search This Blog

Video Of Day

Find Us OIn Facebook

Blogroll

Contact

Tackle the Web with up to 5 new .COMs, $5.99 for the 1st year!

Advertisement