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. Image for the cookie policy date
close icon

Grid Painting Performance

Hi, I use a GDBG and batch updates to the underlying datasource every 250 ms. Whilst doing the updates I suspend binding and drawing. When the updates are complete, I resume binding(OptimizeListChanged event is set to false) and drawing and call Refresh to update the grid. However the Refresh operation takes from 500 to 600 ms to complete. Most of this time is spent in the grids OnPaint method. During this time the usability of the GUI decreases. 1)The mouse tracking becomes jerky 2)Mouse clicks (selecting rows) are delayed 3)Keystroke entry into a non grid text box becomes erratic. If there anything I can do to decrease the time spent painting the grid? Or improve the ability of the main GUI thread to process other messages during the OnPaint method? Cheers Chris.

2 Replies

AD Administrator Syncfusion Team December 9, 2005 02:06 PM UTC

Hi Chris, Take a look at this sample in windows\Grid.Windows\Samples\Performance\TraderGridTest to see if that helps in boosting performance. This sample caches the rectangles that need to be redrawn and then uses DrawClippedGrid to draw these rectangles directly draw these rectangles. Also take a look at this thread in case you are using multithreads. Best regards, Stanley


CD Christopher Dugdale December 15, 2005 03:19 PM UTC

Hi Stanley. I have upgraded the grid to v 3.3 and now cache rectangles and use DrawClippedGrid as in the TraderGridTest. I also had to subclass the ListChanged event so that I could include the column name/index as well as the row index to allow me to do the cell based painting. Painting performance has increased substantially(compared with calling invalidate or Refresh) and has fixed many of my related issues. Thanks very much for the advice! Chris.

Loader.
Live Chat Icon For mobile
Up arrow icon