Back to Devexpress

ASPxSummaryItemBase.SummaryType Property

aspnet-devexpress-dot-web-dot-aspxsummaryitembase.md

latest4.6 KB
Original Source

ASPxSummaryItemBase.SummaryType Property

Gets or sets the aggregate function type.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(SummaryItemType.None)]
public SummaryItemType SummaryType { get; set; }
vb
<DefaultValue(SummaryItemType.None)>
Public Property SummaryType As SummaryItemType

Property Value

TypeDefaultDescription
SummaryItemTypeNone

One of the SummaryItemType enumeration values.

|

Available values:

NameDescription
Sum

The sum of all values in a column.

| | Min |

The minimum value in a column.

| | Max |

The maximum value in a column.

| | Count |

The record count.

| | Average |

The average value of a column.

| | Custom |

Specifies whether calculations should be performed manually using a specially designed event.

| | None |

Disables summary value calculation.

|

Remarks

There are five predefined aggregate functions. These are: Sum , Min , Max , Average , Count. To implement your own aggregate function, set the SummaryType property to Custom , and handle the ASPxGridBase.CustomSummaryCalculate event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SummaryType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-grid-create-report-based-on-grid-layout/CS/WebApplication1/ReportHelper.cs#L73

csharp
label.Summary.FormatString = item.DisplayFormat;
label.Summary.Func = GetSummaryFunc(item.SummaryType);
footerBand.Controls.Add(label);

asp-net-mvc-grid-create-report-based-on-grid-layout/CS/E4755/Models/MVCxGridViewState.cs#L92

csharp
DisplayFormat = item.DisplayFormat;
    SummaryType = item.SummaryType;
}

asp-net-web-forms-grid-create-report-based-on-grid-layout/VB/WebApplication1/ReportHelper.vb#L75

vb
label.Summary.FormatString = item.DisplayFormat
label.Summary.Func = GetSummaryFunc(item.SummaryType)
footerBand.Controls.Add(label)

asp-net-mvc-grid-create-report-based-on-grid-layout/VB/E4755/Models/MVCxGridViewState.vb#L186

vb
DisplayFormat = item.DisplayFormat
    SummaryType = item.SummaryType
End Sub

See Also

CustomSummaryCalculate

Card View

Online Demo: Grid - Grid Totals

Grid View

Online Demo: Card View - Total Summary

Vertical Grid

Online Demo: Vertical Grid - Total Summary

ASPxSummaryItemBase Class

ASPxSummaryItemBase Members

DevExpress.Web Namespace