I have a checkboxlist with 17 checkable items and I want to limit the possible selected items to 6. I am able to do this, but my problem is that the items that have been selected can not be unselected again to select different items ( up until the limit
of 6 ). I have been able to limit the selections using the following code:
private void items_Check(object sender, EventArgs e)
CheckedListBox items = (CheckedListBox)sender;
int selecteditems = items.CheckedItems.Count;
if (selecteditems > 4) // needs to be 4 because the control is validated after input
items.Enabled = false;
How should I proceed if I want to limit the selectable items but give the user the possibility to unselect already selected items ?
Appreciate all the help!
View Complete Post