Add AutoNumber to GridView showing the RowNumber | Quickie

The code below will add a column showing an incremental number near each row, which ultimately is the row number
<asp:TemplateField>
  <ItemTemplate>
    <%# Container.DataItemIndex + 1 %>
  </ItemTemplate>
</asp:TemplateField>
Hope this helped 😉

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *