Footer aggregate in TypeScript Grid control
18 Nov 20181 minute to read
The TypeScript Grid control allows you to calculate and display aggregate values in the footer cells. The footer aggregate value is calculated from all the rows in the grid. You can use the footerTemplate property to render the aggregate value in the footer cells.
- Use the template reference variable name #footerTemplate to specify the footer template.
- Inside the template, access the aggregate values using their corresponding type name. For example, to access the sum aggregate value, use Sum.
Format the aggregate value
To format the aggregate value result in the TypeScript Grid control, you can use the format property of the AggregateColumn. The format property allows you to specify a format string that determines how the aggregate value will be displayed.
How to place aggregates on top of the Grid
By default, the aggregated values are placed at the bottom of the footer section. It is possible to place the aggregated values at the top of the header. This is achieved by using the dataBound event, getHeaderContent, and getFooterContent methods of the Grid.
In the following, footer content is appended to the header content using the dataBound event of the Grid.