GridSummaryItem.SummaryType Property

Gets or sets the aggregation function type.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

[DefaultValue(SummaryItemType.None)]
[XtraSerializableProperty(1)]
[DXCategory("Behavior")]
public SummaryItemType SummaryType { get; set; }
<DefaultValue(SummaryItemType.None)>
<XtraSerializableProperty(1)>
<DXCategory("Behavior")>
Public Property SummaryType As SummaryItemType

Property Value

Type Default Description
SummaryItemType

None

A SummaryItemType enumeration value specifying the summary type.

Remarks

Use the SummaryType property to specify the type of aggregate function used to calculate the summary value. The following predefined aggregate functions are available:

  • sum;
  • minimum value;
  • maximum value;
  • average value;
  • the number of records.
using DevExpress.XtraGrid;

gridView1.OptionsView.ShowFooter = true;

GridColumnSummaryItem siTotal = new GridColumnSummaryItem();
siTotal.SummaryType = SummaryItemType.Count;
siTotal.DisplayFormat = "{0} records";
colOrderID.Summary.Add(siTotal);

GridColumnSummaryItem siAverage = new GridColumnSummaryItem();
siAverage.SummaryType = SummaryItemType.Average;
siAverage.FieldName = "Freight";
siAverage.DisplayFormat = "Average: {0:#.#}";
gridView1.Columns["Freight"].Summary.Add(siAverage);

These five aggregate functions do not limit the types of summaries you can use. You can implement your own aggregate functions. For this purpose, set the SummaryType property to the SummaryItemType.Custom value and write a GridView.CustomSummaryCalculate event handler.

Implements

DevExpress.Data.Summary.ISummaryItem.SummaryType
See Also