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>






0 comments:
Post a Comment