Column footer on hierarchy not updating

8 posts, 0 answers
  1. Darryn
    Darryn avatar
    13 posts
    Member since:
    May 2012

    Posted 03 Jul 2013 Link to this post

    I setup a hierarchy template on my bound GridView. Inside of the hierarchy I have column footer to sum all the values. I have an event that fires in the background that updates the values inside the hierarchy template. However, the sum in the column footer of the hierarchy template does not update. I tried calling CalculateAggregates() on the GridView, but it doesn't seem to do anything for the hierarchy.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Jul 2013 Link to this post

    Hi,

    The AggregateResults in the RadGridView will be updated once a collectionchanged event has been received. How do you edit the value? Would you please follow the editing approach from this help article?
     

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Darryn
    Darryn avatar
    13 posts
    Member since:
    May 2012

    Posted 05 Jul 2013 Link to this post

    The hierarchy template is bound to an ObservableCollection of an custom class that implements INotifyPropertyChanged. The values in the bound collection are being updated by a separate thread. 

    The values in the cells are being updated on the screen, its just the sum in the column footer that does not update.

  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Jul 2013 Link to this post

    Hello,

    As a PropertyChanged notification is received by the GridView, the values in its cells are updated. In order to get the aggregates updated, then a CollectionChanged should be raised from the source collection. You can perform a simple test - would you please sort any of the columns after updating the values from code? Does the aggregate value update?

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Darryn
    Darryn avatar
    13 posts
    Member since:
    May 2012

    Posted 05 Jul 2013 Link to this post

    Sorting does update the value in the sum column.

    Is there a recommended way of firing the CollectionChanged event on the collection?
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 Jul 2013 Link to this post

    Hello,

    Here I have listed the options you have in order to get the GridView's aggregates updated when a value is changed from the source:
    1. Invoke a GridView.Rebind()
    2. Use the approach demonstrated in this help article for editing the items.
    3. Raise a CollectionChanged event for your source collection.
    4. Invoke CalculateAggregates() for the GridView in the hierarchy. 
     
    Do any of those options work for you?

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. Darryn
    Darryn avatar
    13 posts
    Member since:
    May 2012

    Posted 08 Jul 2013 Link to this post

    How do I call CalculateAggregates() on the gridview in the hierarchy?

  8. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 Jul 2013 Link to this post

    Hi,

    You could find the Hierarchy GridView similar to:

    GridViewRow row = this.clubsGrid.GetRowForItem(this.clubsGrid.Items[2]);
    var grid = row.ChildrenOfType<RadGridView>().FirstOrDefault();
    if (grid != null)
    {
        grid.CalculateAggregates();
    } 


    I hope this helps.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top