Click here to Skip to main content
15,907,328 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
how to display row number in Gridview control?
e.g: 1 Sam
2 chris
3 john
4 ...
5 ...
Posted
Comments
CodingLover 6-Dec-11 5:20am    
How did you populate the grid?

Add this
XML
<asp:TemplateField>
    <ItemTemplate>
        <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
</asp:TemplateField>
 
Share this answer
 
XML
<td width=10% class="bkgd-quaternary"><font "header15-s">
                                    <%#Container.DataItemIndex+1 %>
                                    <font></td>



Mark as ans. If solve ur problem
 
Share this answer
 
Try this

<itemtemplate>
<%# Container.DataItemIndex + 1 %> 
</itemtemplate>


Pls view this link for furthr info
Click here
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900