如何从复选框列表中找出已选中和未选中的项目 [英] how to find out checked and unchecked items from checkbox list

查看:113
本文介绍了如何从复选框列表中找出已选中和未选中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有

i我使用复选框列表绑定到没有项目。



这里我的要求是当用户检查20项(选择最大项目20)在该用户尝试选择第21项之后,其余未经检查的项目将自动启用为false(表示无法选择)



这里如何从复选框列表中找到已选中和未选中的项目





请与我分享任何想法。

解决方案

http://www.webcodeexpert.com/search/label/CheckBoxList#.UzKmu6iSzN0 [ ^ ]

列表与LT;列表项> check = CheckBoxList1.Items.Cast< listitem>()。其中​​(c => c.Selected).ToList();< / listitem>< / listitem> 





它将从复选框列表中为您提供所有选定的项目值。

不确定此代码对您有多大帮助。



祝你好运。


hii all
i am using checkbox list is binded to no of items.

here my requirement is when user checked 20 items(select max items 20) in checkbox list after that user try to select 21st item the remaining unchecked items will be automatically enabled false(means unable to select)

here how to find the checked and unchecked items from checkbox list


please share any idea to me.

解决方案

http://www.webcodeexpert.com/search/label/CheckBoxList#.UzKmu6iSzN0[^]


List<listitem> check = CheckBoxList1.Items.Cast<listitem>().Where(c => c.Selected).ToList();</listitem></listitem>



It will give you all the selected items value from the checkbox list.
Not sure how much this code will help you.

Good Luck.


这篇关于如何从复选框列表中找出已选中和未选中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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