Computes summary information, such as total, average, or minimum, for a field in the Grid. Summary values can be displayed on the Grid and used in client-side and server-side expressions.
Summary values compute statistical information about a field in a Grid component. Summary calculations summarize all values on all pages of the Grid, not just values displayed on the visible page.
To enable summary calculations for the Grid, select the field that contains the value you'd like to summarize. Then, enable the desired summary value(s). There are several summary values available:
- Summary Value
Numeric fields only. Displays the total value of the fields in all the records of the table.
Numeric fields only. Displays the count of the fields in all the records of the table.
Numeric fields only. Displays the average value of the fields in all the records of the table.
Displays the minimum value found in the field.
Displays the maximum value found in the field.
- Standard Deviation
Numeric fields only. Displays the standard deviation of the fields in all the records of the table.
Numeric fields only. Displays the variance of the fields in all the records of the table.
Displays the first value found in the field.
Displays the last value found in the field.
The Minimum, Maximum, First, and Last summary calculations are available for all field types. The rest of the summary calculations are only available for Numeric field types.
When a summary calculation is enabled, it exposes two additional properties for the summary type: Display Format and In-line Style. The display format and in-line style can be used to customize the display of the value.
The summary value labels and display location are customized in the Summary value options for the Grid component. You can also use the BeforeSummarySectionRender server-side event to make the inline style conditional on the value of the summary field. See BeforeSummarySectionRender Event for examples.
Summary values can be referenced in expressions for conditional row styling to customize how rows in the Grid component are rendered. See the Grid's Conditional style (client-side) or Conditional style (server-side) for more information.
Summary values are computed on the server. When a row in the Grid is updated, the summary value calculation is not updated unless the Grid component has been set to refresh the "Full page". The Grid's refresh behavior is controlled by the Row refresh method after edit property.
Styling Summary Grid Values
When adding summary values to a Grid, you can customize the look and feel of the values using in-line styles. You can also use the BeforeSummarySectionRender sever-side event to apply conditional styling to a summary field. In this video, we show how to add dynamic styling to summary fields using the BeforeSummarySectionRender event.
These videos show how you can use the OnSummarySectionRender event to customize the summary section of the Grid and inject your own calculated fields into the summary section.
Contrary to what is said in this video, this feature is supported for SQL and DBF data sources.
Group Breaks Using Summary Data
Summary values can be included in Group Headers and Footers in the Grid component. In this video, we show how to add summary values in Group headers and footers.