protected void gvgrid_CustomAggregate(object sender, GridCustomAggregateEventArgs e)
{
if (((Telerik.Web.UI.GridBoundColumn)e.Column).UniqueName == "Actual")
{
Double intNrvalue = 0;
Double intDrvalue = 0;
foreach (GridDataItem item in gvgrid.MasterTableView.Items)
{
intNrvalue += Convert.ToDouble(item["intNumeratorvalue"].Text);
intDrvalue += Convert.ToDouble(item["intDenominatorvalue"].Text);
}
double intResult=(intNrvalue / intDrvalue)*100;
e.Result = intResult;
}
}
Now if we group that grid by dragging one column in the group panel then it should show calculation at the group level(means at group footer). Any help or samples would be appreciated.
E.g. The same functionality is provided for Aggregate="Sum" for a grid bound column by default.When we drag a particular column in a group panel,then it calculates sum at group level in group footer and overall sum at grid footer.