How can I select all the items in a System.Windows.Forms.CheckedListBox
Posted on 2014-04-03
I need to select all the items in CheckedListBox on the check / uncheck of a checkbox click event.
The CheckedListBox is bound to a Generic List as its datasource
chkListBox.CheckOnClick = true;
chkListBox.DataSource = listData;
chkListBox.DisplayMember = "Description";
chkListBox.ValueMember = "Value";
I have also a SelectAll checkbox, when the users checks the SelectAll I want to have all the items in the chkListBox checked.
When the user unchecks the SelectAll checkbox I want all the items unchecked.
I am using .NEt 4.0