与复选框列表有关 [英] related to checkboxlist

查看:115
本文介绍了与复选框列表有关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有1个复选框列表,我想在选择第一个复选框列表的第一个项目时选中第二个复选框列表的所有项目,然后单击seconf时应选择第二个复选框列表项目..怎么可能?

i have 1 checkboxlist and i want to checked all items of second checkboxliston the selection of 1st item of first checkboxlist and on click of seconf second checkboxlist items should be selected..how it can possible?

推荐答案

您循环浏览所有复选框,并使其变为"CHECK ALL"(全部检查)

You loop through all checkboxes and make them "CHECK ALL"

if(boolAllChecked)
 {
     foreach (ListItem listItem in checkListbox1.Items)
     {
          listItem.Selected = false;
     }
 }
 else 
 {
     foreach (ListItem listItem in checkListbox1.Items)
     {
          listItem .Selected = true;
     }
 }  


这篇关于与复选框列表有关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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