简体   繁体   中英

Add subItem to Listview

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

Try this:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM