working with check box list
hey i have a checkbox list , which inside it there are checkbox items ofc. i am trying witho开发者_JAVA技巧ut succuess to understand how to open up an event which is being occured whenever a checkbox list is being checked thanks in advance for your help
I seem to remember that you have to use the CheckedListBox OnClick event.. In the eventhandler you find the selected checkbox, and check it's value.
List<int> groups = new List<int>();
foreach (var item in clbGroup.CheckedItems)
{
ListViewItem foundItem = listViewGroups.FindItemWithText(item.ToString(), false, 0, false);
if (foundItem != null)
{
groups.Add(Convert.ToInt32(foundItem.Tag));
}
}
I am saving all the checked items from the CheckBoxList clbGroup
into groups List<int>
.
精彩评论