Skip to main content
A newer version of this page is available. .

Lesson 4 - Display Summaries

This tutorial demonstrates how to display summaries for groups of rows (group summary) or individual data columns (total summary). This tutorial is based on the Lesson 2.

The GridControl can calculate the following summaries:

  • the number of data rows (Count);
  • the maximum and minimum values (Max and Min);
  • the sum and the average value (Sum and Average).

To add a summary to the GridControl:

  1. Create a GridSummaryItem object and assign it to the GridControl.TotalSummary or GridControl.GroupSummary collection.
  2. Specify the FieldName and SummaryType properties to apply the summary.
  3. Set the DataViewBase.ShowTotalSummary property to true to show the Summary Panel:

    <dxg:GridControl AutoGenerateColumns="AddNew" ItemsSource="{Binding Customers}">
        <dxg:GridControl.TotalSummary>
            <dxg:GridSummaryItem FieldName="Name" SummaryType="Count"/>
        </dxg:GridControl.TotalSummary>
        <dxg:GridControl.GroupSummary>
            <dxg:GridSummaryItem FieldName="Visits" SummaryType="Max"/>
        </dxg:GridControl.GroupSummary>
        <dxg:GridControl.View>
            <dxg:TableView ShowTotalSummary="True"/>
        </dxg:GridControl.View>
    </dxg:GridControl>
    

Refer to the Edit Summaries topic for information on how an end user can create and customize data summaries.

See Also