C#: How do you make sure that a row or item is selected in ListView before performing an action?
I'm not entirely sure what you are asking. Do you want to make sure at least 1 item is selected before running an action? If so the following should work
if ( listView.SelectedItems.Count > 0 ) {
// Do something
}
Or are you curious if a particular item is selected? If so try the following
if ( listView.SelectedItems.Contains(someItem)) {
// Do something
}