This is a migrated thread and some comments may be shown as answers.

Force cell update

6 Answers 499 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Ronald Bouras
Top achievements
Rank 1
Ronald Bouras asked on 23 Mar 2016, 08:00 AM

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

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Mar 2016, 09:01 AM
Hello Ronald,

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.
 
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Peter
Top achievements
Rank 1
answered on 18 May 2017, 09:55 AM

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

0
Peter
Top achievements
Rank 1
answered on 18 May 2017, 11:44 AM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 May 2017, 07:35 AM
Hello 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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Olya
Top achievements
Rank 1
answered on 02 Aug 2017, 02:11 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Aug 2017, 08:54 AM
Hello 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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
VirtualGrid
Asked by
Ronald Bouras
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Peter
Top achievements
Rank 1
Olya
Top achievements
Rank 1
Share this question
or