I am trying to find the index of a particular value from the CheckedListBoxControl. The CheckedListBoxControl has a DataSource, DisplayMember, ValueMember set to a DataTable and two columns receptively. Now I have to set the CheckedState Property to true by finding its index from CheckedListBoxControl by using some value from the ValueMember and then calling the SetItemChecked() method with that index.
I'm not able to find any property or method which returns the index. Please help.
If a list box control is bound to a data source, you can iterate throught all listbox items using the the GetItem() method and the ItemCount property:
To find the index of the specified item you can use the FindItem() method
searching by DisplayText:
searching by ValueMember:
Please also take a look at the "How to get checked rows of a data-bound CheckedListBoxControl" article.