Click to See Complete Forum and Search --> : How to delete and add a row in CListCtrl


Rose Mary
April 18th, 1999, 11:57 PM
Dear All:

My application need to show a bunch of records in a CListView. Since there is memory limitation for a CListView buffer (How big is that ? ), I only show 300 hundreds records at a time. The every record after 300 will be displayed in the list only when the first row of the list is deleted. That means everytime before I add a new row in the end of list of CListView, I want to delete the first record from the list. and then add a new roll at the end of the list of CListView. So the CListView always show 300 latest records.

Can you tell me that how to implement this ?

Thanks a lot.

dolittle
April 19th, 1999, 01:57 AM
Hi,

Isn't CListCtrl::DeleteItem( int nItem ); sufficent?

It enables you to delete the item number nItem (for example: item number 0, will delete the top item) please notice that if you sort your CListCtrl, your 0 item might be not the first item you inserted.