A newer version of this page is available. Switch to the current version.

Data Summaries Overview

  • 2 minutes to read

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

The GridControl supports Total and Group summaries:

  • Total Summary

    An aggregate function value calculated against all rows within a View and displayed in the Summary Panel.

  • Group Summary

    An aggregate function value calculated against all rows within a group and displayed in a group row.

Table View:

Summaries_TableView

Card View:

Summaries_CardView

GridSummaryItem objects represent summaries (group and total). You can specify the field against whose values the summary is calculated, the aggregate function and the summary value format. Total summaries are stored in the GridControl.TotalSummary collection, and group summaries in the GridControl.GroupSummary collection.

Summary Recalculation on Data Updates

The GridControl updates its summary values after you post an edited row’s changes to a data source. Call the DataViewBase.CommitEditing method in the GridViewBase.CellValueChanged event handler to update summary values each time a cell value is edited:

private void view_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e) {
    view.CommitEditing();
}

The GridControl does not update its summaries if you modified the control’s data source directly (without using the control’s UI). Set the DataControlBase.AllowLiveDataShaping property to true to make the control automatically recalculate summaries when the data source changes.

Optimized summary recalculation

The GridControl can update data summaries without recalculating them against all records. Instead, the control calculates delta values against changed records and updates summaries according to these values. As a result, the time required to update summary values does not depend on the number of records.

Set the GridControl.OptimizeSummaryCalculation property to true to enable the optimized summary calculation. The GridControl should be bound to an ObservableCollection or ChunkList<T> whose items implement the INotifyPropertyChanged and INotifyPropertyChanging interfaces. The GridControl cannot optimize the recalculation of custom summaries and summaries for unbound columns.

Concepts

Examples