ListView is extremely slow

  • Thread starter Thread starter Teemu
  • Start date Start date
T

Teemu

I have a listview which contains about 500 items. I was pretty confused when
I realized that it takes over 50 milliseconds to get
Listview.CheckedItems.Count value. How it can be so slow?

In ItemChecked event I have code which sets text "3 items selected" to a
label. When I turn CheckBoxes to True you can imagine how long it takes.

I'm using Visual Basic 2005.

Any good ideas?

Thanks,
Teemu
 
Not surprising actually. CheckedItems.Count actually loops over all items in
your list box and counts the ones that are checked.
How about keeping a counter yourself? Then you only need to add or subtract
1 in the ItemChecked event

/claes
 
Totally sorry, I missed the "Checked" statement. I'll repost if I can
think something else up.

Jason Newell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top