By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,114 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,114 IT Pros & Developers. It's quick & easy.

ListView Keeps Flickering

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.