I have this DataTable
with the following structure:
ID | VALUE
----------------
1 | Item 1
2 | Item 2
3 | Item 3
And I display the values from the DataTable
into a CheckedListBox
control by adding each row as an item.
But how can I include the ID? Is there "DisplayMember" and "ValueMember" like Properties for CheckedListBox control?
The DataSource, DisplayMember and ValueMember properties are available for this control but they are not displayed in the IntelliSense: MSDN
You should be able to use them though.
The french documentation say : Cette propriété ne s'applique pas à cette classe. "This property does not apply for this class". This little line of text is not visible in the us documentation...
Yes there are 'display member' and 'value member' properties in CheckedListBox.
You can set the properties as you do in combobox:
Well yes, there are
DisplayMember
andValueMember
properties onCheckedListBox
, although the docs forValueMember
claim it's "not relevant to this class".Here's a quick example showing
DisplayMember
working:Also note that the docs state:
Given the above code which works, presumably it's talking about more advanced data binding, using
DataSource
?