Search content within the blog

Monday, October 11, 2010

Add a Row Number to the GridView

Here’s a simple way to add a Row Number to the GridView. Just add the following tags to your section of your GridView

<asp:TemplateField HeaderText="RowNumber">
<%# Container.DataItemIndex + 1 %>
and you will get the following output

No comments:

Post a Comment