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

Best way to update a range of cells

I need to update a range of cells. I’m using model.GetCells to put the styles into a GridStyleInfoStoreTable. I’m then modifying the table’s contents and using model.SetCells to update the data. I’m sandwiching this between model.BeginUpdate() and model.EndUpdate() calls. I’m also trying one of: model.Refresh(), gridControl.Refresh(), and gridControl.RefreshRange(range) after the EndUpdate(). The begin/end updates do help with performance when updating the data; even for small sizes the difference is noticeable. Unfortunately, I’m still getting intermittent occurrences of updated cells not showing their new content except when I explicitly select the range. What’s the best way to update the contents of a regular grid? P.s: If it matters, my updates may also have row/column insertions.

2 Replies

ST stanleyj Syncfusion Team November 14, 2005 06:33 AM UTC

Hi Jack, Refresh, RefreshRange, Invalidate and InvalidateRange has to refresh. Here is a sample that is working well. If you can upload your sample, we will look the issue here. Best regards, Stanley


AD Administrator Syncfusion Team November 15, 2005 03:37 PM UTC

Hi Stanley, Turns out I wasn''t always calling the grid update routine in my code. Once I made the fix, everything is working as it should. Sorry to have wasted your time. My update routine does the following: beginupdate, getcells, setcells, endupdate, refreshrange. Is that most efficient way of doing an update to a range of cells or do you guys recommend something else? Thanks.

Loader.
Live Chat Icon For mobile
Up arrow icon