I am having trouble loading a NameValue:
public static NameValue[] Stuff = new NameValue[] {
new NameValue("stringhere1","stringhere2"),
}
into a 2 column ListView. If someone could please help me with the code for looping through the NameValues and adding them as subitems in a 2 column ListView I would be most grateful! :)
Like so:
Column1 / Column2
------------------
stringhere1 / stringhere2
Loading
Bechir BejaouiPosted Jan 27, 2009, 5:19 PM
c.Add("1", "one");
c.Add("2", "two");
c.Add("3", "three");
c.Add("4", "four");
ListView View = new ListView();
ListViewItem[] listViewItem = new ListViewItem[c.Count];
string[] x;
for (int i = 0; i < c.Count; i++)
{
x = c.GetValues(i);
listViewItem[i] = new ListViewItem(new string[] {c.Keys[i],x[i] });
}
try this code