如何在CheckBox列表中选择All / Deselect All [英] How to select All/Deselect All in CheckBox list

查看:101
本文介绍了如何在CheckBox列表中选择All / Deselect All的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好如何在已加载动态项目的复选框列表中选择全部/取消全选。

并且如果未选中所有项目,则应该能够选择单项

Hi How to select All/Deselect All in checkbox list having dynamic item loaded.
and should be able to select single item if select all item is not checked

推荐答案

你可以参考这个



选择,取消选择,所有复选框上最基础 - 的 - 另一个-复选框,在-ASP网-check [ ^ ]
You can refer this

select-unselect-all-checkboxes-on-the-basis-of-another-checkbox-in-asp-net-check[^]


CheckBoxList控件提供了一种清除所有项目选择的方法:清除选择 [ ^ ]

另一方面没有这样的方法,但你可以轻松创建一个...

CheckBoxList control provides a method to clear selection from all items: ClearSelection[^]
On the other side there is no such method, but you can create one easily...
for (int i=0; i < Items.Count; i++)
{
  Items[i].Selected = true;
}



(这是ClearSelection代码的精确副本,除了'true'位...)


(And this is the exact copy of the code from ClearSelection, except the 'true' bit...)


这篇关于如何在CheckBox列表中选择All / Deselect All的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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