Reputation: 2140
With this code I add values in my columns. But the first column is constantly skipped.
This is the code I use:
foreach (Muziek m in lijstMuziek)
{
ListViewItem lvi = new ListViewItem();
lvi.SubItems.Add(m.Rapper);
lvi.SubItems.Add(m.Titel);
lvi.SubItems.Add(m.DuurMinuut.ToString());
listView1.Items.Add(lvi);
}
I changed the displayindex, but that doesn't matter.
Anyone got a clue why this could happen?
Upvotes: 6
Views: 3318
Reputation: 44181
The first item's text goes in ListViewItem.Text
. The subitems are for subsequent columns.
Upvotes: 15