Board index » delphi » ListView questions (Sort and Large number of items in)

ListView questions (Sort and Large number of items in)

Hi,

   I'm trying to sort a listview and it seem the sort method don't apply
to the TListview object, but only to TList and TStringlist.  In the
"reference library guide", in the description of TListView, the sort
method is a "key" method for the TListview.

   My other problem is when adding a large number (+/- 500) of items in
the listview.  The content of the listview is display only when all
items are loaded.  If I refresh the listview each time an item is added,
it's very long. I'd try to use property AllocBy, but I saw nothing
different.  What should I do for my "TListView" to react the same as
listview in Windows 95 Explorer.  

   Tanks in advance    

--------------------------------
Eric Noel de Tilly
Analyste-programmeur
internet: endti...@qc.bell.ca

 

Re:ListView questions (Sort and Large number of items in)


Quote
> Eric Noel de Tilly

>    My other problem is when adding a large number (+/- 500) of items in
> the listview.  The content of the listview is display only when all
> items are loaded.  If I refresh the listview each time an item is added,
> it's very long. I'd try to use property AllocBy, but I saw nothing
> different.

That is exactly what i experienced. Also i found several postings in this
newsgroup wich described the same thing, but i have never found any answer
of use. There are some 'tricks' to make the
listview a little faster, but don't expect to much. I am working with
up to 12000 items, and it takes up to a 1/2 minute on my 486 to update the
list. My opinion is, that you better don't use TListView, if you have a big
amount of items to work with..

But now the 'tricks':
1. Use allocBy before adding a greater amount of items.
2. Call MyListView.Items.BeginUpdate before and ..EndUpdate after adding.
3. Always switch temorarely to viewstyle=list whil adding lots of items.

achim

______________
ac...@free.de

Re:ListView questions (Sort and Large number of items in)


Quote
Achim Koch wrote:

> > Eric Noel de Tilly

> >    My other problem is when adding a large number (+/- 500) of items in
> > the listview.  The content of the listview is display only when all
> > items are loaded.  If I refresh the listview each time an item is added,
> > it's very long. I'd try to use property AllocBy, but I saw nothing
> > different.

> That is exactly what i experienced. Also i found several postings in this
> newsgroup wich described the same thing, but i have never found any answer
> of use. There are some 'tricks' to make the
> listview a little faster, but don't expect to much. I am working with
> up to 12000 items, and it takes up to a 1/2 minute on my 486 to update the
> list. My opinion is, that you better don't use TListView, if you have a big
> amount of items to work with..

> But now the 'tricks':
> 1. Use allocBy before adding a greater amount of items.
> 2. Call MyListView.Items.BeginUpdate before and ..EndUpdate after adding.
> 3. Always switch temorarely to viewstyle=list whil adding lots of items.

> achim

> ______________
> ac...@free.de

   For the display problem, I solve the problem (with the help of E.
Tzagarakis in this newsgroup) by calling Application.ProcessMessages
each time I add an item to the ListView.  It is much faster than refresh
each time the ListView.
--
--------------------------------
Eric Noel de Tilly
Analyste-programmeur
internet: endti...@qc.bell.ca

Other Threads