Listview复选框,选择全部/选择所有C#4.0 [英] Listview checkbox selecting all/Deslecting all C# 4.0
本文介绍了Listview复选框,选择全部/选择所有C#4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我具有列表视图,并且在列表视图中启用了复选框。如何检查列表视图中的所有复选框并取消选择?
I have listview and i have checkboxes enabled in the listview How would i check all the checkboxes in the listview and deselect?
谢谢您
推荐答案
我认为这会为您提供帮助:
I think this will help you:
if (chkSelectAll.IsChecked == true) {
for (int y = listitem.Items.Count - 1; y >= 0; y--) {
System.Windows.Controls.CheckBox chk= (System.Windows.Controls.CheckBox)listitem.Items[y];
chk.IsChecked = true;
}
}
此代码包含在您的活动中。
This code goes inside your event.
这篇关于Listview复选框,选择全部/选择所有C#4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文