Example of Default Aggregate in ASP.NET Core Tree Grid Control

Tree Grid
Aggregates
Default Aggregate

This sample demonstrates aggregate functionality of the TreeGrid. In this sample, the aggregate value for the column "Approved" is displayed in column footer and provide an option to show child summary.

1
Planning
3/2/2017
2
Plan timeline
3/2/2017
3
Plan budget
3/2/2017
4
Allocate resources
3/2/2017
5
Planning complete
7/2/2017
Approved: 2
6
Design
10/2/2017
7
Software Specification
10/2/2017
8
Develop prototype
10/2/2017
9
Get approval from customer
2/13/2017
10
Design complete
2/14/2017
Approved: 2
Properties
Show Child Summary

The TreeGrid supports aggregates which will be displayed at the footer and every hierarchy level. 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 aggregation. The custom aggregate value can be accessed inside template using the key ${custom}

In this demo, the footerTemplate property is used for showing count aggregate for "Approved" column and the footerTemplate using its type name as (${TrueCount}).

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

Additionally, the Tree Grid supports client-side exporting to Excel, PDF, and CSV formats. In this demo, for the toolbar items of exporting, actions are defined in the toolbarClick event to export the Tree Grid data using the excelExport, pdfExport, and csvExport methods.


More information on the data binding can be found in this documentation section.

Transform your ASP.NET Core web apps today with Syncfusion® ASP.NET Core components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE
opens in a new tab