Hi Jacky,
Thanks for using Syncfusion products.
We can have SummaryRows using SummaryRowDescriptor and SummaryColumnDescriptor with GridGroupingControl. Please refer the below code snippet which illustrates your requirement:
$sfwg:GridSummaryRowDescriptor Name="Sum">
$SummaryColumns>
$sfwg:GridSummaryColumnDescriptor DataMember="Col1" Format="{Sum:#}"
Name="Col1Total" SummaryType="Int32Aggregate" DisplayColumn="Col1">
$/sfwg:GridSummaryColumnDescriptor>
$sfwg:GridSummaryColumnDescriptor DataMember="Col2" Format="{Sum:#}"
Name="Col2Total" SummaryType="Int32Aggregate" >
$/sfwg:GridSummaryColumnDescriptor>
$sfwg:GridSummaryColumnDescriptor Name="Col3AVG" DisplayColumn="Col3" SummaryType="DoubleAggregate">
$/sfwg:GridSummaryColumnDescriptor>
$/SummaryColumns>
$/sfwg:GridSummaryRowDescriptor>
$/SummaryRows>
// finding Average for the column1 and column2.
protected void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
switch (e.TableCellIdentity.TableCellType)
{
case GridTableCellType.SummaryFieldCell:
{
if (e.TableCellIdentity.SummaryColumn.Name == "Col1Total")
{
HTot = Convert.ToInt32(e.Style.CellValue);
}
if (e.TableCellIdentity.SummaryColumn.Name == "Col2Total")
{
IDTot = Convert.ToInt32(e.Style.CellValue);
e.Style.CellValue = HTot / IDTot;
}
if (e.TableCellIdentity.SummaryColumn.Name == "Col3AVG")
{
e.Style.CellValue ="" ;
}
break;
}
}
}
Please refer the sample from the belwo link, which illustrates this:
http://www.syncfusion.com/support/user/uploads/Summary_9c2014ae.zipPlease let me know if you have any other concerns.
Regards,
Raji