You can implement your own SetItemChecked(string item);
private void SetItemChecked(string item) { int index = GetItemIndex(item); if (index < 0) return; myCheckedListBox.SetItemChecked(index, true); } private int GetItemIndex(string item) { int index = 0; foreach (object o in myCheckedListBox.Items) { if (item == o.ToString()) { return index; } index++; } return -1; }
CheckListBox uses object.ToString() to display items in a list. You can implement a search method on all objects. ToString () to get the index of the item. When you have an item index, you can call SetItemChecked(int, bool);
Hope this helps.
Daniel PeΓ±alba
source share