Ugly flicker when updating a ListView in VirtualMode

Ugly flicker when updating a ListView in VirtualMode

Post by VWxyaWNoIF » Sat, 29 Mar 2008 01:31:00


Hello,

I am using a ListView derived class in VirtualMode to display millions of
lines (Details view). DoubleBuffering is on.
The underlying data is frequently updated. The ListView is informed of the
update by setting the VirtualListSize property.

There are three scenarios:
1. The ListView always scrolls to the last message. => Everything ok, no
flicker.
2. A row is selected and visible, no scrolling occurs but the underlying
data is still being updated. => Everything OK, no flicker, only the scroll
bar is sligtly moving as expected.
3. A row is selected but the selected row was scrolled outside the visible
area of the ListView and is no longer visible. => Ugly flickering occurs.

I examinded the third scenario and found, that each time I set the
VirtualListSize, the ListView is processing TWO WM_PAINT messages .
In the first, it paints the selected row and the rows adjacent to the
selection (which shouldn't be painted).
The second WMPaint then paints the rows, which are expected to be painted.

I don't know, why there are 2 WM_PAINT messages and how to prevent the first
one, which isn't necessarry and is responsible for the flicker.

I appreciate any idea hot to solve this problem.

Regards

Ulrich Proeller
 
 
 

Ugly flicker when updating a ListView in VirtualMode

Post by Bob Powell » Sat, 29 Mar 2008 03:07:10

ListView wraps the old Win32 ListView control so has very little forms aware
functionality. I don't think double bufering works at-all for it.

Two WM_PAINTS are pretty much standard. The system has been doing it for
years. I'd worry if it only sent one.

The only way I have found for using ListView anywhere near it's true
capabilities - and it is despite all outward appearences really powerful -
is to override the WndProc and start using all the specialised ListView
messages.

To be honest I would advise you to either get a phenomenally good
understanding of ListView or use a different control.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.yqcomputer.com/

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.yqcomputer.com/

Answer those GDI+ questions with the GDI+ FAQ
http://www.yqcomputer.com/

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Ulrich Proeller" < XXXX@XXXXX.COM > wrote in

 
 
 

Ugly flicker when updating a ListView in VirtualMode

Post by VWxyaWNoIF » Sat, 29 Mar 2008 17:08:00

Thanks for your quick answer!


What I need is a fast list control which can show up to a million lines,
resize, reorder and hide columns and show an icon at the beginning of each
line. I don't need editing capabilities, subitems, groups.

Would you propose the Windows GridControl or a commercial ListControl (e.g.
Infragistics)?

Ulrich
 
 
 

Ugly flicker when updating a ListView in VirtualMode

Post by Bob Powell » Tue, 01 Apr 2008 07:24:09

The phrases "Fast control" and "million lines" are not ones that should be
in the same sentence.

Anyone who loads a control with a million lines of data or even uses a
virtual mode to select from that million lines is likely to be disappointed.

I work in a commercial bank where the number of transactions are huge and we
are constantly making trade-offs between performance and quantitiy of lines.
I have never seen a one-size-fits-all solution and we have used
Infragistics, standard Windows Forms, SyncFusion, Dundas, indeed all the
major players were evaluated extensively by our teams. I assure you I've
seen them all and I still can't instantly choose one just from simple
criteria.

Depending on the application we use the control best suited. We have no
financial constraints so all the tools we buy are purely there because they
fulfil a need. We have lots of them and they all apply well to different
tasks.

If you just want raw display of data, stick with a standard Microsoft
control. These are well thought out and fit well into the framework. If you
need pretty but can sacrifice some performance, go for Infragistics.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.yqcomputer.com/

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.yqcomputer.com/

Answer those GDI+ questions with the GDI+ FAQ
http://www.yqcomputer.com/

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Ulrich Proeller" < XXXX@XXXXX.COM > wrote in