The list view is like
i need to add the data from the Listview
to a Dictionary<String,String>
.
Now i'm using for loop
to do this. Is there any way to do this using LINQ
.
Finally the Dictionary will contain
{"A","1"}
{"B","2"}
{"C","3"}
EDIT My code :
Dictionary<String, String> Dic = new Dictionary<string, string>();
for (int i = 0; i < listView1.Items.Count; i++)
{
Dic.Add(listView1.Items[i].Text.ToString(), listView1.Items[i].SubItems[1].Text.ToString());
}
Thanks in advance