My application reads the file names in a folder and presents the data
in a ListView on a form. The CheckBoxes property on the ListView is
true. I want to process each file that the user has checked in the
ListView. I am trying to use the following code:
ListView.CheckedListViewItemCollection checkedItems =
listView1.CheckedItems;
foreach(ListViewItem item in checkedItems)
{
// processing logic
}
When I debug this code, the CheckedItems property and the Items
property in listView1 each contain zero elements.
My ListView is populated on the form, yet when I get to this method it
seems to be empty. Was there some definition I had to do in order to
use it again?