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

Smart Painting

Hi Clay, Want to know whether this is possible in GDBG for example i have the following rows in datatable Symbol Ask Bid MSFT 1 2 GE 3 4 the updates are happening to the underlying datatable, so lets say the bid price of MSFT is changed, this will trigger row list changed event and the GDBG will fire a paint operation for the entire row.. so it means prepareviewstyleinfo event will get triggered for all the columns of MSFT.. but if you look at the data only bid price got changes rest of the columns data remains unchanged.. so ideally there is no need to paint Symbol and Ask columns for MSFT as its underlying data is not changed and is already visible to the users but the only trick is if users brings another window in foreground invalidating the background window then when users again re-enters into the deactivated window then paint operation should be invoked for all 3 columns (MSFT,Ask and Bid).. this would be a huge optimization as it would save considerable amount of cpu cycles in a sceanario where the no. of columns are large in numbers. Do you think it is possible ? Also i have old snippet whereby i am bypassing the internal GDBG overheads by handling the paint operation inside my own specialized class.. this.SupportsPrepareViewStyleInfo=false; this.DrawCell +=new GridDrawCellEventHandler(ExtSyncGDBG_DrawCell); Regards Yogi

2 Replies

AD Administrator Syncfusion Team March 24, 2005 04:54 PM UTC

Yogi, just wanted to check that you got the sample we sent in Direct Trac incident 16800, correct? As far as painting only some of the cells in a row instead of the whole row, if you have access to the code that changes the grid (or changes the datasource), here is something you could try. Before the change, call this.gridDataBoundGrid1.BeginUpdate(Syncfusion.Windows.Forms.BeginUpdateOptions.None); The after the change, call this.gridDataBoundGrid1.EndUpdate(false); Then you could call grid.InvalidateRange to invalidate the single cell that changed. I think this would avoid painting the whole row. If you submit another Direct Trac incident, we can forward you a different sample (also requires new DLLS as the other sample did) that invaldiates things cell by cell though it does use a virtual GridControl bound to a datatable to do this, and not a GridDataBoundGrid.


AD Administrator Syncfusion Team March 24, 2005 08:55 PM UTC

thx Clay.. pls check the incident report i have posted my observation with sample project that uses the real typed dataset Regards Yogi >Yogi, just wanted to check that you got the sample we sent in Direct Trac incident 16800, correct? > >As far as painting only some of the cells in a row instead of the whole row, if you have access to the code that changes the grid (or changes the datasource), here is something you could try. > >Before the change, call > >this.gridDataBoundGrid1.BeginUpdate(Syncfusion.Windows.Forms.BeginUpdateOptions.None); > >The after the change, call > >this.gridDataBoundGrid1.EndUpdate(false); > > >Then you could call grid.InvalidateRange to invalidate the single cell that changed. I think this would avoid painting the whole row. > >If you submit another Direct Trac incident, we can forward you a different sample (also requires new DLLS as the other sample did) that invaldiates things cell by cell though it does use a virtual GridControl bound to a datatable to do this, and not a GridDataBoundGrid.

Loader.
Live Chat Icon For mobile
Up arrow icon