Hello!
I'm using RadDataGridView. I expect, that when data is changed
(i'm using INotify, so that with PropertyChanged event is all ok), aggregate functions have to be recalculated. But this don't happening without additional moves.
On forums there are a lot of advices to use Grid.CalculateAggregate, no matter that it is not good for MVVM. But this function doesn't recalculate anything.
So i tested a lot of variants and i found one, that works how expected, but i think this solve is too complex for this problem.
After data changed i use this code
So my question is: can i recalculate aggregate functions more easily?
More over, attached code works only when i am grouping my collection only by Second property - this is huge problem too.
Here is the simple project which resolve the problem.
I'm using RadDataGridView. I expect, that when data is changed
(i'm using INotify, so that with PropertyChanged event is all ok), aggregate functions have to be recalculated. But this don't happening without additional moves.
On forums there are a lot of advices to use Grid.CalculateAggregate, no matter that it is not good for MVVM. But this function doesn't recalculate anything.
So i tested a lot of variants and i found one, that works how expected, but i think this solve is too complex for this problem.
After data changed i use this code
//Refreshing aggregate functions
var items = MyGrid.Items;
foreach
(var item
in
items)
{
items.EditItem(item);
items.CommitEdit();
}
So my question is: can i recalculate aggregate functions more easily?
More over, attached code works only when i am grouping my collection only by Second property - this is huge problem too.
Here is the simple project which resolve the problem.