logN

How to select All ListView Items Without Iterating thru Items




Re: Windows Forms General How to select All ListView Items Without Iterating thru Items ??

celobateira

Hi logN

Have you tried

System.Windows.Forms.ListView.ListViewItemCollection lc = listView1.Items;

See if it helps

Cheers




Re: Windows Forms General How to select All ListView Items Without Iterating thru Items ??

nobugz

It is only one line of code:

foreach (ListViewItem item in listView1.Items) item.Selected = true;






Re: Windows Forms General How to select All ListView Items Without Iterating thru Items ??

celobateira

Hummm I misunderstood the problem here...it's Select, not Get.

That should work well nobugz. After all it's only a line of code Wink altough it iterates anyway