Check all item in listview with huge list item?

前端 未结 6 863
情书的邮戳
情书的邮戳 2021-01-25 06:19

I want to check about 3000 item in listview. This is a bit of code :

foreach (ListViewItem item in this.lvItem.Items)
{
    item.Checked = !item.Ch         


        
6条回答
  •  一向
    一向 (楼主)
    2021-01-25 07:22

    I had the same problem but I found why.

    I had an "ItemChecked" event handler attached to my listView that was doing some heavy stuff.

    I removed the eventHandler and it solved my problem. Try removing any "ItemChecked" eventhandler and see if the speed is better.

提交回复
热议问题