I’ve got a Dictionary<string, bool> object storing some items and their status: true means enabled, false means disabled.
I’d like to bind this object to a CheckedLIstBox, or alternatively, bind a List<string> and then loop through the Dictionary and use the key to access the CheckListBox items setting their status.
Which is the easiest way?
My suggestion would be to avoid the binding altogether. Microsoft does not promote the use of the DataSource property for a
CheckedListBox.Use the
AddRangemethod to add your collection to theCheckedListBoxat runtime and be done with it.