Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a checklistbox : 30 items ( 1 or 0)
ex : 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
but i want to each item will be name is 1 to 30
1 2 3 4.....
How can i change name of the item in checklistbox?
Posted

You can't set names on CheckedListBox items.

In your case you can use the index of the item as the name (index + 1 that is).
 
Share this answer
 
try to Change in this way

for (int i = 0; i < CheckBoxList1.Items.Count; i++)
           {
               CheckBoxList1.Items[i].Text = Convert.ToString(i);
           }
 
Share this answer
 

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