• Material 3
  • Fluent
  • Bootstrap v5
  • Tailwind CSS
  • High Contrast
Preferences
Theme Selection
Theme Modes
Mode Selection
Touch
Mouse
Localization
*Translated by Google Translator.
Currency

Example of Group and Caption Aggregate in ASP.NET MVC Data Grid Control

This sample demonstrates Aggregate functionality of the Grid. In this sample, both “Unit In Stock” and “Discontinued” columns are displayed their aggregate value in group footer. “Unit In Stock” column displayed its aggregate value in group caption also.

DEMO
SOURCE

The Grid supports aggregates which will be displayed at the footer, group footer and group caption of the Grid. The aggregate configurations can be provided by the Aggregates property.

The built-in aggregates are,

  • Sum
  • Average
  • Min
  • Max
  • Count
  • TrueCount
  • FalseCount
  • Custom - Requires the CustomAggregate property to perform the aggregation. The custom aggregate value can be accessed inside template using the key ${Custom}

In this demo, the GroupFooterTemplate property is used to display the group footer aggregation for the Unit In Stocks and Discontinued columns and GroupCaptionTemplate property is used to display the group caption aggregation for the Unit In Stocks column.

To enable group footer aggregation for Unit In Stocks column, the Sum aggregate type is used by setting the Type and Field property is set as UnitsInStock which will be used to perform the aggregation. The aggregate value is accessed inside the GroupFooterTemplate using its Type name (${Sum}).

To enable group caption aggregation for Unit In Stocks column, the Max aggregate type is used by setting the Type and Field property is set as UnitsInStock which will be used to perform the aggregation. The aggregate value is accessed inside theGroupCaptionTemplate using its Type name (${Max}).

The template expression should be provided inside ${...} the interpolation syntax.

Transform your ASP.NET MVC web apps today with Syncfusion ASP.NET MVC components
85+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE