Back to Devexpress

Group Summary

aspnetbootstrap-117789-grid-view-data-summaries-group-summary.md

latest3.2 KB
Original Source

Group Summary

  • Nov 14, 2018
  • 2 minutes to read

The group summary represents the value of the aggregate function calculated over all data rows within a group. Group summaries are displayed within group rows or group footer cells.

Group summaries are represented by the ASPxSummaryItem objects. Bootstrap Grid View stores its group summaries within the ASPxGridView.GroupSummary collection. To manage this collection at design time, you can use the Edit Form as shown above.

The ASPxSummaryItem object provides two properties allowing you to determine the location to display the summary.

To obtain group summary values, use the following methods.

MethodDescription
ASPxGridView.GetGroupRowSummaryTextReturns the summary text displayed within the specified group row.
ASPxGridView.GetGroupSummaryValueReturns a summary value calculated against the specified group of rows.
ASPxSummaryItem.GetGroupRowDisplayTextFormats the specified value according to the current group row summary item’s format settings.
ASPxGridViewSettings.ShowGroupFooterSpecifies the ASPxGridView group footers visibility.
ASPxSummaryItem.GetGroupFooterDisplayTextFormats the specified value according to the current total summary item’s format settings, when the summary is displayed within group row footers.

Example: Creating a Group Summary in Code

This example shows how to create and customize a group summary in code.

csharp
ASPxSummaryItem groupSummary = new ASPxSummaryItem();
groupSummary.FieldName = "Budget";
groupSummary.SummaryType = SummaryItemType.Max;
BootstrapGridView1.GroupSummary.Add(groupSummary);
vb
Dim groupSummary As ASPxSummaryItem = New ASPxSummaryItem()
groupSummary.FieldName = "Budget"
groupSummary.SummaryType = SummaryItemType.Max
BootstrapGridView1.GroupSummary.Add(groupSummary)