Skip to main content

GridColumn.SummaryItem Property

Provides access to the column’s footer summary settings.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

[DXCategory("Data")]
[XtraSerializableProperty(XtraSerializationVisibility.Content)]
[XtraSerializablePropertyId(2)]
public GridSummaryItem SummaryItem { get; }

Property Value

Type Description
GridSummaryItem

A GridSummaryItem object containing the column’s footer summary settings.

Remarks

Grid allows you to add single or multiple total summaries for a column. Use this property to add a single summary within a column footer, or the GridColumn.Summary property to add multiple total summaries.

Use the SummaryItem property to set up the column’s footer summary. The object returned by this property allows you to set the field against whose values the summary is calculated, the aggregate function applied to field values, and the summary value format. Note that you can choose one of the predefined aggregate functions or implement your own function. Refer to the Summaries help topic and the GridSummaryItem class description for additional information.

Summary Item 1

Footer summaries are displayed within footer cells corresponding to columns.

Example

The example demonstrates how to calculate a single total summary for a grid column via the GridColumn.SummaryItem property.

Adding Single Summary Item

colUnitsInStock1.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average;
colUnitsInStock1.SummaryItem.DisplayFormat = "Average = {0:n2}";
See Also