ListView and Inserting Subitems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

How do you append/set subitem within a row

For example given this listview

0 1 2 3 4
1 2 3

In row 2, I'd like to add "5" after the "4." Class ListView supports adding a new row via ListViewItem.

How do you append a new subitem to an exist row

How do you set the entire row

Thanks

Kuphryn
 
Hi,
You can use
this.listview.Items[row].SubItems.Insert to add a "5" after the "4"

To insert a new row use
this.listview.Items.Add("");
this.listview.Items[row].SubItems.AddRange(new string[]{"0","1"};

hth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top