I’m executing this code:
for (int i=0; i< 15; i++)
{
ListViewItem lvi = new ListViewItem();
lvi.SubItems.Add(“One”);
lvi.SubItems.Add(“Two”);
lvi.SubItems.Add(“Three”);
this.listView1.Items.Add(lvi);
}
and getting this result (image attached):
That seems correct. Subitems start at the second column. The first column is the item. See attached image from the same code in winforms.
Hi Conrad,
I get exactly the same in WinForms. Which result were you expecting ?
To set the value of the first column in your sample, try setting lvi.Text.
Hope that helps.
Best regards
Frank
You’re right, I forgot Winforms, been programming VWG for about years and the code I posted was VWG. Suggestions worked fine. Sorry for false alarm and thanks for the responses 🙂
Please login first to submit.