Obtain Summary Values

ASPxGridView supports two types of summaries: Total Summary and Group Summary. This topic provides information on how to obtain summary values in code.

Obtain Total Summary Value

ASPxGridView stores its total summary items within the ASPxGridView.TotalSummary collection. To obtain the required summary item's value, use the ASPxGridView.GetTotalSummaryValue method.

int siValue = Convert.ToInt32(ASPxGridView1.GetTotalSummaryValue(
         ASPxGridView1.TotalSummary["UnitPrice", DevExpress.Data.SummaryItemType.Max]));

To obtain the total summary item's display text, use the ASPxSummaryItem.GetTotalFooterDisplayText method.

Obtain Group Summary Value

Group summary items are stored within the ASPxGridView.GroupSummary collection. Use the ASPxGridView.GetGroupSummaryValue method to obtain the required summary item's value calculated against the specified group of rows.

int gsiValue = Convert.ToInt32(ASPxGridView1.GetGroupSummaryValue(0, ASPxGridView1.
GroupSummary["Discontinued", DevExpress.Data.SummaryItemType.Count]));

To get the summary text displayed within the specified group row, use the ASPxGridView.GetGroupRowSummaryText method.

See Also