Skip to main content

GridViewSettings.GroupSummary Property

Provides access to group summary items.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.1.dll

NuGet Package: DevExpress.Web.Mvc5


public ASPxSummaryItemCollection GroupSummary { get; }

Property Value

Type Description

AnASPxSummaryItemCollection object representing the group summary collection.


Group summaries are displayed within group rows when data grouping is applied. Summary items are represented by the ASPxSummaryItemCollection objects and are stored within the GroupSummary collection. This collection provides methods and properties that allow you to add, remove and access summary items.


In database server mode, a summary cannot be calculated for unbound columns whose values are calculated via events (see GridViewSettings.CustomUnboundColumnData). Only columns with unbound expressions (see GridViewDataColumn.UnboundExpression) support summary calculation.


This sample demonstrates how to use the GridViewSettings.SummaryDisplayText delegate method to define custom texts for group and total summaries displayed within the GridView.


Html.DevExpress().GridView(settings => {
    settings.Name = "dxGridView";
    settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, "ShipName");
    settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "UnitPrice").DisplayFormat = "c";
    settings.SummaryDisplayText = (sender, e) => {
        if(e.Item.FieldName == "UnitPrice")
            e.Text = string.Format("Sum of unit price: ${0}", Convert.ToDouble(e.Value));
        if(e.Item.FieldName == "ShipName")
            e.Text = string.Format("Count of records: {0}", Convert.ToDouble(e.Value));
See Also