Adding an object to listview-item?

  • Thread starter Thread starter Boris Nienke
  • Start date Start date
B

Boris Nienke

hi,

i would like to store an object along with an listview-item. Something
like:

ListViewItem item = new ListViewItem();
item.Text = "Text"
item.SubItems.Add("Text2")

item.Object = MyObject;

listview1.Items.Add(item);

Is this possible? And how to get the selected item/object when the user
clicks the item?

thank you

Boris
 
Create your own ListViewItem by deriving from it and add
Object or Tag property.

HTH... Alex
 
Back
Top