Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridColumnSummaryItem Class

A column’s total summary item.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.2.dll

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

#Declaration

public class GridColumnSummaryItem :
    GridSummaryItem

#Remarks

Enable the View’s OptionsView.ShowFooter property to display the total summary footer.

You can display multiple total summaries for a column. To add summaries, use the GridColumn.Summary collection. This collection’s elements are GridColumnSummaryItem objects.

The GridColumnSummaryItem objects have the following properties:

The image below shows total summaries in a column’s footer.

GridColumnSummariesSingle

#Example

The example demonstrates how to add a total summary and set its summary type, field name and display format. Note that a summary is added for the Units In Stock column and it will be shown in this column. However, the summary will be calculated against a Unit Price field name.

gridView1.OptionsView.ShowFooter = true;

GridColumnSummaryItem item = colUnitsInStock1.Summary.Add();
item.SummaryType = DevExpress.Data.SummaryItemType.Average;
item.FieldName = "UnitPrice";
item.DisplayFormat = "Average Unit Price = {0:c2}";

#Inheritance

Object
GridSummaryItem
GridColumnSummaryItem
See Also