ListView Keeps Flickering

ListView Keeps Flickering

Post by wackyphil » Wed, 10 Nov 2004 00:42:57


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?
 
 
 

ListView Keeps Flickering

Post by Q2hyaXMgQm » Wed, 10 Nov 2004 01:28:02

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

 
 
 

ListView Keeps Flickering

Post by C# Learne » Wed, 10 Nov 2004 02:39:45

 
 
 

ListView Keeps Flickering

Post by wackyphil » Wed, 10 Nov 2004 08:13:42

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.
 
 
 

ListView Keeps Flickering

Post by Otis Mukin » Wed, 10 Nov 2004 09:40:58


Sounds like a good idea to me...

Otis Mukinfus
http://www.yqcomputer.com/
 
 
 

ListView Keeps Flickering

Post by Anders Eri » Wed, 10 Nov 2004 16:55:11


When you have done it PLEASE make it open source and share it

// Anders
 
 
 

ListView Keeps Flickering

Post by Allen Ande » Fri, 24 Dec 2004 06:38:34

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