20 August 2013

Add a Row Number to the GridView

 <asp:GridView ID="gv1" runat="server">
                        <Columns>
                            <asp:TemplateField HeaderText="RowNumber">
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

No comments:

Post a Comment