Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing list view without deleting columns in VB.Net?

Tags:

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. :(

like image 616
user2765899 Avatar asked Sep 23 '13 12:09

user2765899


1 Answers

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
like image 160
Steven Doggart Avatar answered Sep 28 '22 18:09

Steven Doggart