I have a WinForms ListView, obviously containing ListViewItems. I’d like to be able to attach a click event to each item, instead of to the entire ListView (and then trying to figure out what item was clicked). The reason for this is that I need to perform a different action based on which item was selected. The ListViewItem class seems to be very limited in this regard. Is there any way to do what I want, or am I forced to use the ListView.Click event?
I have a WinForms ListView, obviously containing ListViewItems. I’d like to be able to
Share
I would still use the ListView Click event.
A trick I’ve used in these situations is to use the Tag property of a ListViewItem. It’s great for storing per item data and you can put anything in it.