Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello all,


i want autonumber in datagridview.
Posted
Comments
#realJSOP 21-Jan-11 7:52am    
And what have you tried?

1 solution

The easiest way is to add one more item template column to grid and paste this code into it
<%# Container.DataItemIndex + 1 %>
 
Share this answer
 
v2
Comments
[no name] 21-Jan-11 7:56am    
i want vb.net code
Martin Arapovic 21-Jan-11 7:58am    
Ups, I saw that you are looking for VB.NET Forms application after i click post! Sorry :)
Martin Arapovic 21-Jan-11 8:01am    
There are also many examples on net for this. Check this
http://dotnetfaqs-edu.blogspot.com/2009/01/add-autonumber-column-in-datagridview.html
http://www.dotnetspark.com/kb/298-auto-generate-row-number-to-datagridview.aspx
[no name] 21-Jan-11 21:07pm    
first link is helpfull for me. thanks lots.

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