开发者

working with check box list

开发者 https://www.devze.com 2023-01-26 06:20 出处:网络
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

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>.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号