Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
UltraGrid Invalidate() flicker
posted

I am working on a financial application that needs to handle real-time price updates. Prices changes are highlighted by setting the back colour to green or pink. There is a timer that fades back to the default back colour after a couple of seconds.

I am currently testing this functionality and have found that the grid flickers heavily when the data is updated and the grid needs to repaint. Currently I'm simulating 10,000 updates per second. I also have a timer that ticks every second to fade the changed price's cell back to it's defalt colour. At the end of each fade step I need to invalidate the grid. 

These two operations cause the mouse to flicker unacceptably and also cause the  docked control I also have on the same Form to take several seconds to fully in a very jerky fashion now.

 Is there a way to improve performanc/smoothness?

Thanks

Jay 

Parents
No Data
Reply
  • 2070
    posted

    Hi Jay,

     

    What you can do is use BeginUpdate/EndUpdate methods of the UltraGrid to throttle how often it repaints, like 3-4 times a second. This way every cell update will not result in an invalidation or subsequent processing, but rather the entire grid will repaint set number of times a second. Also there are certain settings you can apply to speed up rendering. I've attached a test sample that throttles grid paint. It also sets some things in the InitializeLayout event handler to speed up grid painting.

     

    Hope this helps,

    Sandip

    WinGridPaintThrottling.zip
Children
No Data