Skip to main content

GridColumn.Summary Property

Allows you to add multiple total summaries for a column. These summaries are displayed within the View Footer.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v23.1.dll

NuGet Package: DevExpress.Win.Grid


[XtraSerializableProperty(true, true, true, 1000)]
public GridColumnSummaryItemCollection Summary { get; }

Property Value

Type Description

A GridColumnSummaryItemCollection object that is a collection of column total summaries.


You can calculate multiple total summaries for a single column via the Summary property. Total summaries, which are calculated against all rows, are displayed in the View Footer. To display the View Footer, use the GridOptionsView.ShowFooter property, accessible via the GridView.OptionsView property.

The Summary object is a collection of summaries. Each summary is a GridColumnSummaryItem object. To add multiple total summaries for a column, you can use the GridColumnSummaryItemCollection.Add method, provided by the Summary object.

You can also add summary items at design time via the grid’s summary collection editor. To open the editor, locate the Summary property in the Properties window and click on the ellipsis button.

Summary Collection Editor

Summary Collection Editor 2

An end-user can add multiple summaries for a column at runtime, via the Footer Context Menu. This feature is controlled by the GridOptionsMenu.ShowAddNewSummaryItem property.

If you need to calculate only one summary item for a column, you can use the column’s GridColumn.SummaryItem property instead of adding the summary items to the Summary collection. The first element of Summary collection is synchronized with a column’s GridColumn.SummaryItem property.

Online Video

WinForms Grid: Multiple Summary Values Under the Same Column.


This example demonstrates how to add multiple total summaries for a column at runtime.

Adding Summaries In Code - Result

using DevExpress.XtraGrid;

gridView1.Columns["UnitsInStock"].Summary.Add(new GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Average, "UnitsInStock", "Avg={0:n2}"));
gridView1.Columns["UnitsInStock"].Summary.Add(new GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Sum, "UnitsInStock", "Sum={0}"));
gridView1.Columns["UnitsInStock"].Summary.Add(new GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Max, "UnitsInStock", "Max={0}"));
See Also