简体   繁体   中英

Clearing list view without deleting columns in VB.Net?

I need help regarding list view. I'm trying to remove the records in my list view but when I try to use lvRecords.Clear() it also removes the columns that I need. I just need to clear the records not the columns. :(

According to the MSDN , the ListView.Clear method

Removes all items and columns from the control.

To clear just the items, you need to call the Clear method on the Items property. Try this instead:

lvRecords.Items.Clear

将列设置放在一个单独的方法中,然后一旦清除它,请调用setup方法

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