I'm working with a winForms app that has a listView. That listView has multi-select enabled and I have many, many items in the list (in row view).
When I select the last row (i.e. item), then shift-click the 5000th row, SelectedIndexChanged fires 5000 times. If this happens, I end up in a very nasty loop. The last row clicked is not guaranteed to be the last item in the "SelectedItems" list. How do I get the actual item clicked?
EDIT: Better clarification: How do I get my hands on the ListViewItem that CAUSED this particular iteration of the SelectedIndexChanged event? ... even if I have to check all 5000 of them. I need to know which one I'm looking at. EventArgs does not have an index property, and sender is the ListView, not the ListViewItem.
Any thoughts?