Swag
Swag

Reputation: 2140

Listview skips first column

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);
        }

Listview

I changed the displayindex, but that doesn't matter.

Anyone got a clue why this could happen?

Upvotes: 6

Views: 3318

Answers (1)

Dark Falcon
Dark Falcon

Reputation: 44181

The first item's text goes in ListViewItem.Text. The subitems are for subsequent columns.

Upvotes: 15

Related Questions