Wednesday, September 4, 2013

how to get auto increment number in a grid view?

use the following template field in asp.net gridview to get the auto increment number

<asp:TemplateField HeaderText="No">
    <ItemTemplate>
        <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
</asp:TemplateField>

No comments:

Post a Comment