DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Data Grid - Group Summaries

To configure group summaries, populate the summary.groupItems array with summary configuration objects. Each object should specify a column that supplies data for summary calculation and a summaryType—an aggregate function that should be applied to this data.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

Position a Group Summary

Group summaries are displayed in parentheses after the group caption. You can reposition them as follows:

  • Display a summary in a column
    You can align a summary to its corresponding column (see the Sale Amount and Total Amount columns). To do this, enable the alignByColumn property. If you want to align a summary to a different column, specify the showInColumn property.

  • Display Summary Values within Group Footers
    You can make a summary item display its values within group footers. To do this, enable the showInGroupFooter property. Summary items will appear within their corresponding columns (see the Total Amount column). If you want to display summaries in another column, specify the showInColumn property.

Format Summary Values

To format summary values, use the valueFormat property. This demo applies the "currency" format to summary values calculated against the Total Amount and Sale Amount columns. If you also want to add custom text to summary values, use the displayFormat property. This demo sets this property for summaries of "sum" and "count" types.

Sort Groups by Summary Values

This demo sorts groups by summary values (the number of orders). To do this, the code adds an object to the sortByGroupSummaryInfo array. The object specifies the summaryItem whose values are used to sort the group rows.