I want to maintain both ID and Object Type in my ListView. I\'m trying to do this:
lstView.Items.Insert(MyObject);
// can\'t do this, because it takes only Int
Quickest way around this is to keep a list of your object on the side:
List list = ... ; // my list
Generate a dictionary from the list with a string as the ID, or you can use the index to retrieve from the original list:
Dictionary listBinder = new Dictionary(
list.Select(i => new KeyValuePair(i.ID, i.Name))
);
Bind or codebehind attaching the listview to the dictionary, then use the selected item to retrieve your object from your private list.