You can do it by adding the flowing line of code on GridView ItemTemplate HTML
<%# Container.DataItemIndex + 1 %>
Example:
<asp:GridView ID="GridView1" AutoGenerateColumns="true" runat="server">
<Columns>
<asp:TemplateField HeaderText="Sequence">
<ItemTemplate>
<%# Container.DataItemIndex + 1 %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
No comments:
Post a Comment