Add subItem to Listview

535 views Asked by At

Now, I know how to add SubItems, but this time it's slightly different from my usual method. below is what I'm using to add items to my listview, however using this I cannot figure out how to add subitems.

listView1.Items.Add(Path.GetFileName(f));
1

There are 1 answers

1
Anthony McGrath On BEST ANSWER

Try this:

listView1.Items.Add(Path.GetFileName(f));

listView1.Items[0 /* or any index you need */].SubItems.Add("SubItem");