且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Listview复选框,选择全部/选择所有C#4.0

更新时间:2023-11-20 21:47:16

我认为这会为您提供帮助:

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.