Board index » delphi » Adding ListItems to ListView is so s-l-o-w

Adding ListItems to ListView is so s-l-o-w

Is there a way of improving the perfomance of adding items (and subitems) to
a listview? I am using Items.BeginUpdate and Items.EndUpdate, which do make
a big difference but I want this to be much faster. I have also experimented
with AllocBy, but so far I don't see that it makes any noticable difference.
 

Re:Adding ListItems to ListView is so s-l-o-w


Quote
G Horn wrote:
> Is there a way of improving the perfomance of adding items (and subitems) to
> a listview? I am using Items.BeginUpdate and Items.EndUpdate, which do make
> a big difference but I want this to be much faster. I have also experimented
> with AllocBy, but so far I don't see that it makes any noticable difference.

I've solved this problem by filling the listview for only what is visible on
screen. After that, I put in the Application.OnIdle event the code to complete
the listview.

--

Pieter van Erp

    "It ain't over 'till the Fat Lady sings"

Re:Adding ListItems to ListView is so s-l-o-w


Have you tried putting LockWindowUpdate(ListView1.Handle); and
LockWindowUpdate(0); around the insert code ?

"G Horn" <gth...@icon.co.za> schreef in bericht
news:398da365$0$232@hades.is.co.za...

Quote
> Is there a way of improving the perfomance of adding items (and subitems)
to
> a listview? I am using Items.BeginUpdate and Items.EndUpdate, which do
make
> a big difference but I want this to be much faster. I have also
experimented
> with AllocBy, but so far I don't see that it makes any noticable
difference.

Re:Adding ListItems to ListView is so s-l-o-w


No, I haven't tried what you suggest yet, but isn't that the same as
BeginUpdate and EndUpdate?

Quote
M.H. Avegaart <avega...@NOSPAMmccomm.nl> wrote in message

news:8mr7fe$g1u$1@porthos.nl.uu.net...
Quote
> Have you tried putting LockWindowUpdate(ListView1.Handle); and
> LockWindowUpdate(0); around the insert code ?

> "G Horn" <gth...@icon.co.za> schreef in bericht
> news:398da365$0$232@hades.is.co.za...
> > Is there a way of improving the perfomance of adding items (and
subitems)
> to
> > a listview? I am using Items.BeginUpdate and Items.EndUpdate, which do
> make
> > a big difference but I want this to be much faster. I have also
> experimented
> > with AllocBy, but so far I don't see that it makes any noticable
> difference.

Other Threads