ListView Keeps Flickering

P

Phill

I've got a Listview control (Detail mode) that I'm adding rows to on
another thread from a DB query.

The result is about 32,000 rows ans takes a while to finish.

I'm adding the rows like this : lv.Items.Add( lvi );

It seems the entire control is redrawing even though usually the new
rows being added are not visible. I don't remember this being the case
in Win32. Anyway w/ all the flickering going on the LV control is too
hard to read to be useful while the populating occurs and I want to
see if this can be fixed.

Any ideas how?
 
G

Guest

You can either use BeginUpdate() & EndUpdate() around your calls to
Items.Add, or build an array of the items to be added and then add the lot at
once using AddRange().

HTH,
Chris
 
P

Phill

BeginUpdate() is borderline useless.

You will still get flicker and it's not the least bit practical to
have your listview control sit there empty for like 45 seconds while
it populates.

Its rediculous that the control redraws for items that are not in
view. That's just asinine & I'm very surprised the controls behave
this way.

I guess I'm going to end up writing my own.
 
O

Otis Mukinfus

BeginUpdate() is borderline useless.

You will still get flicker and it's not the least bit practical to
have your listview control sit there empty for like 45 seconds while
it populates.

Its rediculous that the control redraws for items that are not in
view. That's just asinine & I'm very surprised the controls behave
this way.

I guess I'm going to end up writing my own.

Sounds like a good idea to me...

Otis Mukinfus
http://www.otismukinfus.com
 
A

Allen Anderson

I ran into that same problem which is why I ended up writing my own
listview as well.
 

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

Top