Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting TlistView entries? 2

Status
Not open for further replies.

yomyom

Programmer
Dec 23, 2002
119
GB
Dear delphi gurus,
I can load data into a TListView component, but I don't know how to delete the entries.
Can anyone helpout?
 
From the Delphi help:

DeleteSelected Procedure
Call DeleteSelected to remove all selected items from the list control. DeleteSelected deletes only the item or items that are selected.

I've tried it and all you have to do is:
Code:
  ListView1.DeleteSelected
Clive [infinity]
 
Thanks clive,
How do I select all programatically? I want to delete all entries so I can load / add new entries without the user being aware.
yomyom
 
Clive,
I tried the above code and it didn't work. Any other suggestions, or is the an error with my delphi version. I use D4.
yomyom.
 
How about a clean and simple:

Code:
Listview1.Items.Clear;

That should do.

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top