Force cell update

7 posts, 1 answers
  1. Ronald Bouras
    Ronald Bouras avatar
    11 posts
    Member since:
    Jun 2010

    Posted 23 Mar 2016 Link to this post

    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

  2. Answer
    Dess
    Admin
    Dess avatar
    2107 posts

    Posted 24 Mar 2016 Link to this post

    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.
  3. Peter
    Peter avatar
    51 posts
    Member since:
    May 2016

    Posted 18 May Link to this post

    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

  4. Peter
    Peter avatar
    51 posts
    Member since:
    May 2016

    Posted 18 May Link to this post

    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

  5. Dess
    Admin
    Dess avatar
    2107 posts

    Posted 19 May Link to this post

    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.
  6. Olya
    Olya avatar
    1 posts
    Member since:
    Aug 2017

    Posted 02 Aug in reply to Dess Link to this post

    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

  7. Dess
    Admin
    Dess avatar
    2107 posts

    Posted 03 Aug Link to this post

    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.
Back to Top