I'm adding hundreds of items to a ListView control and as the number of
items in the list goes up the longer it takes to add the next item. Is
there a faster way to add items to a TListView? Or is there a better
control? Or maybe a better method to manage large items of lists?
Thanks
-grant
gra...@novell.com
Mylistview.EndUpdate
if that doesn't work, try disabling it while updating, this should stop it
from redrawing
HTH
--
Vincent Parrett
Albury, NSW, Australia
Email : remove_ = antispam
Email : remove_...@albury.net.au_remove
Web : http://www.albury.net.au/~vparrett
Grant Johnson <Gra...@Novell.com> wrote in article
<3378e...@gronk.provo.novell.com>...
>
>I'm adding hundreds of items to a ListView control and as the number of
>items in the list goes up the longer it takes to add the next item. Is
>there a faster way to add items to a TListView? Or is there a better
>control? Or maybe a better method to manage large items of lists?
One way is to create a TStringList, add all the items to that, the use the
ListBox.Items.Assign method to make your stringlist the list for the listbox.
Be sure to do the hourglass cursor thing, or put up a 'loading...' sign, or
something.....
>
>
>Thanks
>
>-grant
>gra...@novell.com
>
>
David Jameson
updating
Grant Johnson wrote:
> I'm adding hundreds of items to a ListView control and as the number
> of
> items in the list goes up the longer it takes to add the next item. Is
>
> there a faster way to add items to a TListView? Or is there a better
> control? Or maybe a better method to manage large items of lists?
>
> Thanks
>
> -grant
> gra...@novell.com
Before adding call Items.BeginUpdate to prevent list contents frm
updating which needs a lotof time. After you finished call
Items.EndUpdate to refresh contents on screen.
******************************************
Baltic Advanced Technologies
Solutions for software developers
http://www.batsoft.com
We know you need the help.
Here it is!!!
OverPLAY,OverDIG,OptStyle and more...
******************************************
Turn the sort off. This will speed it up.
---
Peter
> In article <3378e...@gronk.provo.novell.com>,
> "Grant Johnson" <Gra...@Novell.com> wrote:
> >I'm adding hundreds of items to a ListView control and as the number of
> >items in the list goes up the longer it takes to add the next item. Is
> >there a faster way to add items to a TListView? Or is there a better
> >control? Or maybe a better method to manage large items of lists?
Set ListView's AllocBy property to a larger value. Help says:
The AllocBy property prepares a list view control for adding a large
number of items. Set AllocBy before adding a large number of items.
AllocBy enables a list view control to reallocate its internal data
structures only once rather than every time you add an item.
Bye,
Boris
--
Boris Herman, Sight & Sound Slovenia
E-mail: mailto:in...@sight-sound.si
WWW: http://www.sight-sound.si
ICQ: http://wwp.mirabilis.com/907377
ICQ-Add: http://wwp.mirabilis.com/cgi-bin/uinadd?to=907377