forum

Home / DeveloperSection / Forums / ListView CheckedItems find item by name

ListView CheckedItems find item by name

Jayden Bell 2397 04-Sep-2013

I need to check if an item with a particular name exists in the CheckedItems collection of a ListView.

So far I've tried:

ListViewItem item = new ListViewItem(itemName);

if (listView1.CheckedItems.IndexOf(item) >= 0)

   return true;

and

ListViewItem item = new ListViewItem(itemName);

if (listView1.CheckedItems.Contains(item))

   return true;

Neither of those worked. Is there a way to do this without looping through CheckedItems and checking them one by one?


c# c# 
Updated on 04-Sep-2013

Can you answer this question?


Answer

1 Answers

Liked By