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

Difference between updating using GridData and model.SetCells

What''s the difference between updating a range of cells using the GridData object and doing the same thing using gridmodel.SetCells? When should I use one and not the other? Thanks

3 Replies

ST stanleyj Syncfusion Team March 5, 2006 01:04 PM UTC

Hi, You can directly access the GridData object instead of using an indexer on the grid. This will avoid events and probably be a factor of 5 - 10 times faster. Please refer this thread for more details. Best regards, Stanley


AD Administrator Syncfusion Team March 6, 2006 05:35 PM UTC

Hi, I know (from reading this forum) that the grid indexer is more of a convenience feature and less of a practical and performance feature so I don''t use it. My question was regarding the use of the gridmodel.SetCells(range, gridstyleinfostoretable) which seems to exist for doing bulk updates to the grid. I''m just wondering which is faster and when you would use one over the other. Thanks.


AD Administrator Syncfusion Team March 7, 2006 04:15 PM UTC

Hi, Assigning data through the GridData will be faster compared to SetCells method. If you trace in the source code ( GridData.cs and GridControl.SetCells( ) ), you can find the SetCells method is in turn calling another methods ( SetCellInfo ( ) and GridStyleInfoStore ) to set the data. Where as, in the GridData the data is directly assigned to the grid. Refer to the source code for more details. Best regards, Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon