Example of Default Aggregate in ASP.NET Core Data Grid Control
This sample demonstrates the aggregate functionality of the Grid. In this sample, the aggregate values for the columns are displayed in the column footer.
The Grid supports displaying aggregates in its footer, group footer and group caption.
The aggregate configurations can be provided by the aggregates
property.
Built-in aggregates:
Sum
Average
Min
Max
Count
TrueCount
FalseCount
Custom
- Requires thecustomAggregate
property to perform aggregation. The custom aggregate value can be accessed inside template using the key${custom}
.
In this demo, the footerTemplate
property is used to display four different aggregates (${Sum}
, ${Average}
, ${Max}
and ${Min}
) in the Grid footer.
Each aggregate type is specified using the type
and field
properties accessed in the footerTemplate with its type name.
The aggregate value will be formatted based on its format
value (N2 or C2) before being displayed.
The template expression should be provided inside ${...}
the interpolation syntax.
In this demo, the
footerTemplate
property is used to display four different aggregates (Sum
, Average
, Max
, Min
) for the EnergyProduced field in the Grid footer. Each aggregate type is specified using the
type
and field
properties accessed in the footer template by its type name. The aggregate value will be formatted based on its format
value (N2) before being displayed.