470,624 Members | 2,538 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,624 developers. It's quick & easy.

ListView Keeps Flickering

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?
Nov 16 '05 #1
5 4334
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

"Phill" wrote:
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?

Nov 16 '05 #2
Phill <wa********@yahoo.com> wrote:
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.


Check out <http://tinyurl.com/5ystr>.
Nov 16 '05 #3
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.
Nov 16 '05 #4
On 8 Nov 2004 15:13:42 -0800, Phill wrote:
I guess I'm going to end up writing my own.

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

// Anders
Nov 16 '05 #5
I ran into that same problem which is why I ended up writing my own
listview as well.

On 8 Nov 2004 15:13:42 -0800, wa********@yahoo.com (Phill) wrote:
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.


Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Joaquin Grech | last post: by
2 posts views Thread by Anushya devi | last post: by
9 posts views Thread by C# Learner | last post: by
2 posts views Thread by John Lee | last post: by
2 posts views Thread by John Lee | last post: by
5 posts views Thread by jtalbot_vizible | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.