Sunday, September 27, 2009

Adding Row Number to GridView - ASP.NET

GridView is a control which is used in all applications, most of the time showing a Row number in the left side of each row is needed. after adding a gridview on your aspx page then you should add template column , do the following things.
As the picture shows , you should set "Container.DataItemIndex + 1"  to Text property of Label within a asp:TemplateField in Columns .



No comments:

Post a Comment

Thank you for sharing your knowledge and experiences with this weblog.