GridColumnSummary Class

A data summary item.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.1.dll

Declaration

public class GridColumnSummary :
    BindableObject,
    IToDecimalConverter,
    ICloneable,
    INotifyPropertyChanged,
    ICancellableReader
Public Class GridColumnSummary
    Inherits BindableObject
    Implements IToDecimalConverter,
               ICloneable,
               INotifyPropertyChanged,
               ICancellableReader

The GridControl allows you to display concise information about groups of rows or individual data columns. For example, you can display the number of records, or maximum value, etc. This is called a summary.

Two summary types are supported: total summaries and group summaries. The grid stores its total summary items within the GridControl.TotalSummaries collection. Group summary items are stored within the GridControl.GroupSummaries collection. Individual summary items are represented by the GridColumnSummary class.

When specifying a data summary in the grid, use GridColumnSummary object properties to specify the field against whose values a summary should be calculated (GridColumnSummary.FieldName), the summary value format (GridColumnSummary.DisplayFormat) and the aggregate function (GridColumnSummary.Type). Note that you can calculate summaries using predefined aggregate functions (SummaryType.Count, SummaryType.Min, SummaryType.Max, SummaryType.Sum or SummaryType.Average) or your own custom rule (set the GridColumnSummary.Type property to SummaryType.Custom and handle the GridControl.CalculateCustomSummary event).

Examples

This example shows how to calculate group and total summaries for grid columns using predefined aggregate functions or a custom rule.

The following data summaries are created.

  • Group summary to display the maximum value in a Total column for each group of records.
  • Total summary to calculate the sum of values by the whole Total column.
  • Custom total summary to count the number of rows whose value in the Shipped column is false.

Grid_GettingStarted_Lesson5_Result_iOS

Grid_GettingStarted_Lesson5_Result_Android_Dark

void OnCalculateCustomSummary(object sender, CustomSummaryEventArgs e) {
    if (e.FieldName.ToString () == "Shipped")
    if (e.IsTotalSummary){
        if (e.SummaryProcess == CustomSummaryProcess.Start) {
            count = 0;
        }
        if (e.SummaryProcess == CustomSummaryProcess.Calculate) {
            if (!(bool)e.FieldValue)
                count++;
            e.TotalValue = count;
        }
    }
}

Inheritance

Object
GridColumnSummary

See Also