There appears to be an issue with Aggregate Functions in GroupFooters not getting updated until you leave the row. I read this post about it that said it should be fixed but I am still not seeing the issue fixed in version 2012.1.215.
This is what I did. I created a new project and added a RadGridView. Added a couple of columns that are bound to my data. So that when I open the application it looks like screenshot1.
I then drag column Chud2 up into the Group Panel so it looks like screenshot2.
I then edit any field in column 1 and tab to column 2 and the Total: Aggregate for column 1 does not get updated as shown in screenshot3.
If I hit my Enter key or click to another row then the Total: Aggregate for column 1 gets updated as shown in screenshot4.
I have tried hooking up to the Grid's CellEditEnded event as recommended in other posts and calling the CalculateAggregates() method there but that does not solve the problem either.
My .xaml code is as follows:
And my code behind is as follows:
Am I missing something that would make the Group Footers update their Aggregates when you tab out of a cell?
Thanks,
Chad
This is what I did. I created a new project and added a RadGridView. Added a couple of columns that are bound to my data. So that when I open the application it looks like screenshot1.
I then drag column Chud2 up into the Group Panel so it looks like screenshot2.
I then edit any field in column 1 and tab to column 2 and the Total: Aggregate for column 1 does not get updated as shown in screenshot3.
If I hit my Enter key or click to another row then the Total: Aggregate for column 1 gets updated as shown in screenshot4.
I have tried hooking up to the Grid's CellEditEnded event as recommended in other posts and calling the CalculateAggregates() method there but that does not solve the problem either.
My .xaml code is as follows:
<
Window
x:Class
=
"RadControlsWpfApp6.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadGridView
x:Name
=
"radGridView"
AutoGenerateColumns
=
"False"
ShowGroupFooters
=
"True"
CellEditEnded
=
"radGridView_CellEditEnded"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
x:Name
=
"_colChud"
UniqueName
=
"Chud"
DataMemberBinding
=
"{Binding Chud}"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
"Total: "
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
x:Name
=
"_colChud2"
UniqueName
=
"Chud2"
DataMemberBinding
=
"{Binding Chud2}"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
"Total: "
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
Window
>
And my code behind is as follows:
namespace RadControlsWpfApp6
{
/// <
summary
>
/// Interaction logic for MainWindow.xaml
/// </
summary
>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
radGridView.ItemsSource = Data.GetData();
}
private void radGridView_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
{
radGridView.CalculateAggregates();
}
}
public class Data
{
private double _chud;
public double Chud
{
get { return _chud; }
set { _chud = value; }
}
private double _chud2;
public double Chud2
{
get { return _chud2; }
set { _chud2 = value; }
}
public static ObservableCollection<
Data
> GetData()
{
ObservableCollection<
Data
> data = new ObservableCollection<
Data
>();
Data d = new Data() { Chud = 1, Chud2 = 1 };
data.Add(d);
d = new Data() { Chud = 2, Chud2 = 1 };
data.Add(d);
d = new Data() { Chud = 3, Chud2 = 1 };
data.Add(d);
d = new Data() { Chud = 4, Chud2 = 1 };
data.Add(d);
return data;
}
}
}
Am I missing something that would make the Group Footers update their Aggregates when you tab out of a cell?
Thanks,
Chad