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

[Solved] Group Aggregation Issue

3 Answers 216 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard
Top achievements
Rank 1
Richard asked on 13 Aug 2011, 01:42 PM
Hi

I have ran into the known problem with group aggregation not being updated when INotifyPropertyChanged property is fired.  I can not use CellEditCommit event as the INotifyPropertyChanged event is being fired within my view model and I will not know the amount being changed.  Basically when an end user changes currencies then all the cells readjust to the new exchange rate value, see attached pics, top is before a different currency is selected and the second one is when it has been changed.  As you can see column aggregate does change and the individual cells, but the group does not.

On a second issue (see picture 3), as you can see I am using the group aggregation in header solution with alignment to colums you gave out.  I have got it not to show a group footer when expanded, but header info goes away.  Is there a way to retain the group aggregation information in the header with alignment even when expanded and not have a group footer?

I am using build 2011.2.712.1040.

Regards

Richard....


3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Aug 2011, 08:48 AM
Hi Richard,

Generally, the grid will update the aggregates, the sorting and groping order, etc. on collection changed, not on property changed. What you may do is to invoke such collection change by using the methods EditItem(dataItem) and CommitEdit() like follows:

private void Button1_Click(object sender, RoutedEventArgs e)
        {
            Club clubForEdit = this.clubsGrid.Items[5] as Club;
            this.clubsGrid.Items.EditItem(clubForEdit);
            clubForEdit.StadiumCapacity = 1;
            this.clubsGrid.Items.CommitEdit();
            this.clubsGrid.CalculateAggregates();
        }

I am attaching a sample project so that you may test the functionality right away.
Considering the second issue, the style depends on the GroupFooterRow. Actually, the idea in the alignment of the aggregates in the header row is to transfer the group footer row above so that it fits into the header row. That is why you need it set.
  Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Richard
Top achievements
Rank 1
answered on 18 Aug 2011, 05:54 PM
Hi Maya, Yes I know that edit commit would work, if I knew the value being edited. Basically the cell is made up of class that updates itself automatically whenever the currency type is changed, which is raised in another view model. The new value is then raised as a property change event, which it is. Is there any other way, other then edit commit to force the grid to recalculate the aggregates? My client did not like the footer idea, only complained that the header went missing when expanded! Regards Richard.....
0
Maya
Telerik team
answered on 19 Aug 2011, 02:00 PM
Hi Richard,

I am sending you a sample project executing a scenario similar to the one you described. As you may see the item is updated in the dynamically in the view model. Still, all groups and aggregates are calculated correctly. Please take a look at the application and let me know whether it is helpful for meeting your requirements.

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
GridView
Asked by
Richard
Top achievements
Rank 1
Answers by
Maya
Telerik team
Richard
Top achievements
Rank 1
Share this question
or