firstLevelSourceDataGrid.GroupSummaryRows.Add(new GridSummaryRow()
{
ShowSummaryInRow = false,
Name = "summary",
SummaryColumns = new System.Collections.ObjectModel.ObservableCollection<Syncfusion.Data.ISummaryColumn>()
{
new GridSummaryColumn()
{
Name = "UnitPrice",
SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate,
Format="{Sum:c}",
MappingName="UnitPrice"
},
}
});
firstLevelSourceDataGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "UnitPrice" });
viewDefinition.DataGrid = firstLevelSourceDataGrid;
this.sfDataGrid1.DetailsViewDefinitions.Add(viewDefinition); |
Hi Josip,Thank you for using Syncfusion controls.Based on the provided information, we suspect that you did not add the GroupColumnDescription for ChildGrid column. If you want to add the summary for DataGrid, you should add the GroupColumnDescription for any column in that DataGrid.Please refer the below code snippet,C#:
firstLevelSourceDataGrid.GroupSummaryRows.Add(new GridSummaryRow(){ShowSummaryInRow = false,Name = "summary",SummaryColumns = new System.Collections.ObjectModel.ObservableCollection<Syncfusion.Data.ISummaryColumn>(){new GridSummaryColumn(){Name = "UnitPrice",SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate,Format="{Sum:c}",MappingName="UnitPrice"},}});firstLevelSourceDataGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "UnitPrice" });viewDefinition.DataGrid = firstLevelSourceDataGrid;this.sfDataGrid1.DetailsViewDefinitions.Add(viewDefinition);Sample link: https://www.syncfusion.com/downloads/support/forum/147726/ze/DetailsView_Summary-1325423712We hope it helps, please revert us back, if you need further assistance.Regards,Susmitha S