slow listview...

  • Thread starter Thread starter Roger
  • Start date Start date
R

Roger

Hi,

I'm trying to insert a large (12 000+) set of items into a listview and it
takes forever to do it (maybe 70 sec). Currently I'm using an xpath query to
find the nodes I need from a large xml doc and add each item found in a for
each.... loop.

Is there any way to speed things up?

Regards,
Roger
 
Roger said:
I'm trying to insert a large (12 000+) set of items into a listview
and it takes forever to do it (maybe 70 sec). Currently I'm using an
xpath query to find the nodes I need from a large xml doc and add
each item found in a for each.... loop.

Is there any way to speed things up?

12000 is pretty much...

Tried putting it between

listview.beginupdate
'...
listview.endupdate

?
 
I'm trying to insert a large (12 000+) set of items into a listview (...)

What do you want to do with such an enormous listview...?!

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
************************************
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
 
Just list a lot of names their birthdates and an address :-)

I'm open to suggestions of alternate way to do this, but I can hardly be the
only person in the need for listing a lot of rows in a listview...or?

roger
 
Hei again Armin. Yes I already did, it does help significantly, but that is
what dropped me from several minutes to the 1 minute I'm at now.... :-)

Still need to get further down or find an alternate way to display this
data...
 
Roger said:
Hei again Armin. Yes I already did, it does help significantly, but
that is what dropped me from several minutes to the 1 minute I'm at
now.... :-)

Still need to get further down or find an alternate way to display
this data...


Code to fill a listview with view=detail, 5 columns, 10,000 items:

Dim i As Integer
Dim Items As ListView.ListViewItemCollection
Dim s As Integer

s = Environment.TickCount
items = Me.ListView1.Items
Me.ListView1.BeginUpdate()

For i = 1 To 10000
Items.Add( _
New ListViewItem( _
New String() { _
i.ToString, _
"Column 2", "Column 3", "Column 4", "Column 5" _
} _
) _
)
Next

Me.ListView1.EndUpdate()
s = Environment.TickCount - s
MsgBox(s)


The code takes 0.84 seconds to execute.
 
Back
Top