Skip to main content

Lesson 4: Display Summaries

  • 2 minutes to read

This tutorial demonstrates how to display summaries for groups of rows (group summary) or individual data columns (total summary).

WinUI Grid - Display Summaries

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)
  • Custom summaries

Show Total Summary

WinUI Grid - Get Started Total Summary

Follow the steps below to display the total summary that allows you to display the total number of items:

  1. Set the DataControlBase.ShowFixedTotalSummary property to true to show the Fixed Summary Panel.
  2. Create a GridTotalSummaryItem object and add it to the GridControl.TotalSummary collection.
  3. Set the SummaryItemBase.SummaryType property to Count to apply the summary.
  4. Set the GridTotalSummaryItem.Alignment property to Right to display the summary on the right side of the Fixed Summary Panel.
<dxg:GridControl ShowFixedTotalSummary="True" ...>
    <dxg:GridControl.TotalSummary>
        <dxg:GridTotalSummaryItem SummaryType="Count" Alignment="Right"/>
    </dxg:GridControl.TotalSummary>
    <!-- ... -->
</dxg:GridControl>

Show Group Summary

WinUI Grid - Get Started Group Summary

Follow the steps below to display the group summary that allows you to summarize unit prices in each group:

  1. Create a GridGroupSummaryItem object and add it to the GridControl.GroupSummary collection.
  2. Specify the SummaryItemBase.FieldName and SummaryItemBase.SummaryType properties to apply the summary.
  3. Specify the SummaryItemBase.DisplayFormat property to display the group summary in the currency format.
<dxg:GridControl ...>
    <dxg:GridControl.GroupSummary>
        <dxg:GridGroupSummaryItem FieldName="UnitPrice" SummaryType="Sum" 
                                  DisplayFormat="Sum of Unit Price is {0:c}"/>
    </dxg:GridControl.GroupSummary>
    <!-- ... -->
</dxg:GridControl>
See Also