We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

"Flicker" when updating cells in a "trader-like" real-time virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

51230 Oct 31,2006 07:07 PM Nov 3,2006 02:33 AM Windows Forms 5
loading
Tags: GridControl
Erik Harris
Asked On October 31, 2006 07:07 PM

Hi,

I'm trying to get optimum performance for a frequently updating grid. Using your Trader grid example, I've implemented the DrawClippedGrid method for drawing updated cells. This works great as far as performance is concerned, but there's a "flicker" occasionally when a cell updates. On another thread, there was a reply that mentioned something about drawing the clipped grid to a bitmap, then drawing the bitmap to the grid (but no code). I've tried to implement this solution, but cannot get it working. I've attached the code I'm using:



DrawBitmapToGridCell.zip

Administrator [Syncfusion]
Replied On November 1, 2006 12:58 AM

Hi Erik,

The flickering problem can be avoided by calling the Refresh method between the BeginUpdate() and EndUpdate() calls.

grid.BeginUpdate();
////code///
grid.EndUpdate( false );

Let me know if this helps.

Best Regards,
Haneef

Erik Harris
Replied On November 1, 2006 10:04 AM

Thanks for your reply, Haneef.

I'd like to avoid calling the "Refresh" method at all (for performance), which is why I'm using the DrawClippedGrid method for updating the cell.

If I wrap the DrawClippedGrid method call in the BeginUpdate - EndUpdate calls as you recommended, the flicker remains.

I was interested in the idea of drawing the clipped grid to a bitmap, then drawing the bitmap to the cell. Any sample code available for this option?

Thanks for your support.
Erik

Administrator [Syncfusion]
Replied On November 2, 2006 12:43 AM

Hi Erik,

Instead of CreateGridGraphics(), if you could use GetCachedGraphics() (ver. 4.1), there will be better performance.

Please refer to the attached sample that caches the graphics object across paint calls and disposes it only when the grid gets disposed or its size was changed. The only further improvement you can do is to set:

this.gridControl1.UseDoubleBuffer = false;
this.gridControl1.UseGDI = true;

Sample : http://www.syncfusion.com/Support/user/uploads/PerformanceGrid_dce3029d.zip

Best Regards,
Haneef

Erik Harris
Replied On November 2, 2006 04:00 PM

Haneef,

Thanks again for your help.

With your suggestions, I've once again improved the performance of my grid.

Any suggestions for eliminating the flicker?

Erik

Administrator [Syncfusion]
Replied On November 3, 2006 02:33 AM

Hi Erik,

There is another way you can freeze the painting. This technique works for any control and is discussed in one of our WIndows Forms FAQ. It adds aFreezePainting property to teh class that you can turn on and off. This technque has worked in situations where BeginUpdate is being cancelled for special reasons. Here is a forum thread that has teh references to the FAQ and includes a sample of how to use it.

Maybe this technique will work for you.

http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=9290

Thanks,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;