Grand Total Rows

Summary

  • AdapTable Layouts can include a Grand Total Row which displays aggregated information

Layouts can include a Grand Total Row which will display the totals for all Aggregated Cells.

Note

  • Grand Total Rows use whichever aggFunc is being applied in the Column being aggregated
  • Unlike "normal" aggregations, Grand Total Rows display even if Row Grouping is not applied

This is done via the GrandTotalRow property which can be set to one of 6 values:

Hint

The GrandTotalRow property is in the LayoutBase object, and therefore available in both Table and Pivot Layouts

  • top - row is displayed at top of grid
  • bottom - row is displayed at bottom of grid
  • pinnedTop - row is pinned to the top of grid
  • pinnedBottom - row is pinned to the bottom of grid
  • true - equivalent to pinnedTop
  • false - row is not displayed (same as null)

Hint

Row Summaries are a more powerful and configurable alternative (but available only in Table Layouts)

Aggregations: Grand Total Row
Fork
  • This demo provides 3 Layouts all of which have 3 Aggregated Columns - Github Stars (sum), Github Watchers (sum) and Issue Change (min) - and a Grand Total Row
    • Grouped Layout - the Grid is Row Grouped and the Grand Total Row is at the top
    • Pivot Layout - the Grid is Pivoted and the Grand Total Row is at the bottom
    • Standard Layout - the Grid has now Row Groups and the Grand Total Row is pinned to the top

Formatting

By default, Grand Total Rows will be included in all Column Formatting and Styling.

This behaviour can be changed by configuring the RowScope property when defining the Format Column.

The RowScope object enables 4 types of rows to be excluded from the Format Column:

  • Data Rows
  • Grouped Rows
  • Summary Rows
  • Grand Total Rows - the focus of this page

Hint

Use the ExcludeDataRows option to create a Format Column that is only rendered in a Grand Total Row

Aggregations: Grand Total Row Formatting
Fork
  • This demo contains a Grand Total Row with 3 Aggregated Columns, and 3 Format Columns each with a different RowScope:
    • Github Watchers includes Grand Total Row but excludes Data Rows
    • Github Stars excludes Grand Total Row but includes Data Rows
    • Issue Change includes both Grand Total Row and Data Rows