Hi everybody,
we are extensively using your great new RadVirtualGrid.
We currently have this problem:
If an underlying data item of a row is being edited in a separate editor or values have been updated by database queries: how do we force an update on the cell?
Obviously somehow the event CellValueNeeded has to be refired; but how do we do that?
We already tried:
MyVirtualGrid.Invalidate()
MyVirtualGrid.Refresh();
MyVirtualGrid.Update();
Thanx in advance,
regards
Ronald
6 Answers, 1 is accepted
Thank you for writing.
In order to force the CellValueNeeded event to be fired, you should call the RadVirtualGrid.TableElement.SynchronizeRows method.
I hope this information helps. Should you have further questions I would be glad to help.
Dess
Telerik
Helle Dess,
I had the same Problem: In the Events FilterChanged, SortChange I have to refill a DataTable as Cache.
With RadVirtualGrid.TableElement.SynchronizeRows now the Cell values arr Updated.
But not the controls in the page row at bottom of the grid. This change only after a click in a paging control.
How can I refresh the paging row?
Peter
Hello Dess,
after get the new data in the cache (DataTable), I update RowCount
this
.radVirtualGrid1.RowCount =
this
.cache.TotalCount;
this
.radVirtualGrid1.TableElement.SynchronizeRows();
and the property this.radVirtualGrid1.TotalPages shows the correct new value.
But this.radVirtualGrid1.TableElement.PagingPanelElement will not updated. I found a solution:
this
.radVirtualGrid1.TableElement.PagingPanelElement.UpdateView();
The Api Help is a little poor:
PagingPanelElement.UpdateView Method
Explicitly synchronizes the view with its owner.
Regards,
Peter
Thank you for writing back.
The paging panel must be updated after changing the RowCount. I have logged it in our feedback portal and I have added a vote for it on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.
I have also updated your Telerik points.
Currently, as you have already found out the possible solution is to call the PagingPanelElement.UpdateView method.
I hope this information helps. If you have any additional questions, please let me know.Regards,
Dess
Telerik by Progress
Hello, Dess
I'm trying to use RadVirtualGrid.TableElement.SynchronizeRows method asynchronocally to force CellValueNeeded, but it falls with "Collection was modified" exception.
The whole thing i'm rying to do is this: I'm trying to organize a column with images. I fill it with predefined icons at first and start an async image processing(generating thumbnail), after it is finished i want to fire CellFormating event to change cell image to the generated thumbnail.
What way of solving my problem can you recommend me?
Olga
Thank you for writing.
I would recommend you to use a BackgroundWorker for loading the images. Thus, in the RunWorkerCompleted event, you can call the SynchronizeRows method to force refreshing the grid. Additional information how to use a BackgroundWorker is available here: https://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik