Click here to Skip to main content
15,918,193 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I insert Ordinal number i any listbox....

ex I have a listbox with these data:

ListBox1
Ronaldo
Mesi
Gomes
Ribery

and now I want to have ordinal number in a listbox like:
1.Ronaldo
2.Mesi
3.Gomes
4.Ribery
Posted
Comments
Steve Echols 10-May-12 2:30am    
You'll have to manually update the text of each ListItem. Where are you getting your data from?

1 solution

You can use DataSource property, so you can have a field do be displayed and a field to be used as value of the selected element(s). You only have to add you elements as shown in the sample.
Or, you might create an OwnerDraw listbox version.
 
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