I am new to WinForms and I can’t understand how to add my additional data to a ListViewItem? I remember that in MFC, I can use SetItemDataPtr but how to do this in WinForms?
I am new to WinForms and I can’t understand how to add my additional
Share
You can use the ListViewItem.Tag property to store a reference to any object, the equivalent of SetItemDataPtr(). The Name property can be handy to act as a key in a Dictionary<>. And the Index property could be useful to index a List<>. The latter two approaches are the better solutions, you normally want to keep the data separate from the view.