禁用多选下拉菜单中的复选框 [英] disable the checkbox in multiselect dropdown

查看:78
本文介绍了禁用多选下拉菜单中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多选下拉列表。这里我可以选择多个值。在那个选项中有全部。当我选择全部时,我想检查所有复选框或禁用它。请帮助我。

i have one multiselect dropdown.Here i can select multiple values.In that one option is there "ALL".when iam selecting "ALL" i want to check all the check boxes or disable it.Please help me.

推荐答案

尝试在选择项目时发生事件,然后过滤全部

像这样:



Hi, try to make an event in selecting the item, then filter "ALL"
Like this:

private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
     if (checkedListBox1.SelectedItem.ToString() == "ALL")
     {
          checkedListBox1.Enabled = false;

          for (int x = 0; x < checkedListBox1.Items.Count; x++)
          {
              checkedListBox1.SetItemChecked(x, true);
          }

          //OR DO SOMETHING..

     }
}


请使用 [ ^ ]

开源实现拥有所有功能,包括选择所有功能。
Please use [^]
Open source implementation Its having all functionality including select ALL feature.


这篇关于禁用多选下拉菜单中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆