We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Aggregates in Hierarchy Grid

Hi,

Is Aggregates Footer feature is available in Hierarchy Grid ?

Thanks & Regards
Pardeep Pandit




1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team February 6, 2020 05:17 AM

Hi Pardeep , 
 
Greetings from Syncfusion support 
 
Query : Is Aggregates Footer feature is available in Hierarchy Grid ? 
 
Yes, the Aggregate footer feature is available in hierarchy grid. Please refer the below code snippet and sample for your understanding. 
 
App.component.ts 

import { Component, OnInit, ViewChild } from '@angular/core'; 

@Component({ 
    selector: 'app-root', 
    templateUrl: 'app.component.html', 

export class AppComponent { 
    public data: Object[] = []; 

    ngOnInit(): void { 
        this.data = employeeData; 
        this.childGrid = { 
            dataSource: hierarchyOrderdata, 
            queryString: 'EmployeeID', 
            columns: [ 
                { field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 }, 
                    
            ],aggregates: [{ 
            columns: [{ 
                type: 'Sum', 
                field: 'Freight', 
                format: 'C2', 
                footerTemplate: 'Sum: ${Sum}' 
            }] 
 
App.component.html 

<div class="control-section"> 
    <ejs-grid #grid [dataSource]='data' [toolbar]="toolbar" [childGrid]="childGrid"> 
        <e-columns> 
             
        </e-columns> 
    </ejs-grid> 
</div> 
 
 
 
Please get back to us if you need further assistance 
 
Regards 
Prasanna Kumar N.S.V 
 


Loader.
Live Chat Icon For mobile
Up arrow icon