I'm trying to add items to a ListView control. I wish to add the items with a text value (which is shown) and a hidden key value that it has when it is selected.
I've tried the following code:
string flows_path = "C:\\temp\\Failed Electricity flows\\";
List<ListViewItem> flows_loaded = new List<ListViewItem>();
foreach (string s in Directory.GetFiles(flows_path, "*.rcv").Select(Path.GetFileName))
{
ListViewItem new_item = new ListViewItem(s, 1);
ListViewItem.ad
// Add the flow names to the list
flows_loaded.Add(new_item);
}
But it tells me that ListViewItem doesn't have an overload of (string, int) and it doesn't appear to have a 'value', 'text' or 'key' value that I can set.
ListViewItem("My Item") works, but I don't know how to implement a key for each item.
Tagproperty of every ListViewItem to store and retrieve the key value.