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

Column footer on hierarchy not updating

7 Answers 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Darryn
Top achievements
Rank 1
Darryn asked on 03 Jul 2013, 03:33 PM
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.

7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 04 Jul 2013, 07:59 AM
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 >>
0
Darryn
Top achievements
Rank 1
answered on 05 Jul 2013, 03:06 PM
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.

0
Dimitrina
Telerik team
answered on 05 Jul 2013, 03:18 PM
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 >>
0
Darryn
Top achievements
Rank 1
answered on 05 Jul 2013, 03:54 PM
Sorting does update the value in the sum column.

Is there a recommended way of firing the CollectionChanged event on the collection?
0
Dimitrina
Telerik team
answered on 08 Jul 2013, 01:21 PM
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 >>
0
Darryn
Top achievements
Rank 1
answered on 08 Jul 2013, 07:55 PM
How do I call CalculateAggregates() on the gridview in the hierarchy?

0
Dimitrina
Telerik team
answered on 09 Jul 2013, 12:09 PM
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 >>
Tags
GridView
Asked by
Darryn
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Darryn
Top achievements
Rank 1
Share this question
or