Try the following:
// Get an array of all selected items ListViewItem[] selectedItems = (from i in listView.Items where i.Selected select i).ToArray(); // Delete the items foreach (ListViewItem item in selectedItems) listView.Items.Remove(item);
EDIT
I just noticed that the ListView class already has the SelectedItems property. To make sure that you are not changing the collection that you are executing, I will first copy this collection: Strike>
It seems the above (using AddRange ) doesn't work. I thought that deleting items by iterating over SelectedItems enumerated would throw an exception, but obviously this is not the case. So my source code will be changed according to other answers ... sorry for posting non-functional code ...
source share