Yes, that part is easy. What I want to be able to do is remove an item from a listbox/listview by a unique key. I see that the ListView control has a unique key accessor, which is assigned using one of two of the overloaded ListView.Items.Add() methods:
ListView.Items.Add(string key, string text, string imageKey)
or
ListView.Items.Add(string key, string text, string imageIndex)
However, there isn't an overload that allows me to assign a unique key to an item I would like to add using a ListViewItem object:
ListViewItem lvi = new ListViewItem(SerialNumber.ToString()); lvi.SubItems.Add(Name); lvi.SubItems.Add(Type().ToString()); ListView.Items.Add(lvi); <- No overload that allows me to assign a key to this ListViewItem
Hopefully this gives you a better understanding to what I am trying to accomplish.
|