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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom Aggregate doesn't work

Thread ID:





136540 Mar 19,2018 03:01 PM UTC Mar 20,2018 01:18 PM UTC ASP.NET Core - EJ 2 1
Tags: DataGrid
Massimo Giambona
Asked On March 19, 2018 03:32 PM UTC

The example on documentation about customAggregate doesn't work.

The property customAggregate looking for a c# object not a javascript function, and if I create a C# function like this

object Foo()
     return 0;

the result is not displayed.

<ejs-grid id="Grid" dataSource=@ViewBag.DataSource allowPaging="true">
<e-aggregate-column field="ShipCountry"  type="Custom" footerTemplate="Brazil Count:${Custom}" customAggregate="customAggregateFn">e-aggregate-column>
<e-grid-pagesettings pageCount="5">e-grid-pagesettings>
<e-grid-columns> <e-grid-column field="CustomerID" headerText="Customer Name" width="150">e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="160">e-grid-column>
<e-grid-column field="OrderDate" headerText="Order Date" format="yMd" textAlign="Right" width="130">e-grid-column>              
<e-grid-column field="ShipCountry"  headerText="Ship Country" width="140">e-grid-column>               

function customAggregateFn (data) {

    return data.result.filter(function (item) {
        return item['ShipCountry'] === 'Brazil';

Is possible to completely customize the groupFooter and/or the captionFooter has a single line like this:

Customer: 100, Budget: € 15.000,00 - AmountTotal € 18.000  


Dhivya Rajendran [Syncfusion]
Replied On March 20, 2018 01:18 PM UTC

Hi Massimo, 
Thanks for contacting Syncfusion support, 
We have validated your query and prepare a sample for your reference, In this below sample we have used load event to assign the value for the customAggregate properties, kindly please refer the below sample and code snippet for more information, 

    <ejs-grid id="Grid" dataSource="ViewBag.datasource" load="load " allowPaging="true" allowSorting="true" allowFiltering="true"> 
                   . . . . . 
                    <e-aggregate-column field="ShipCountry" type="Custom" footerTemplate="Brazil Count:${Custom}"></e-aggregate-column> 
         . . . . 
    function load() { 
        this.aggregates[0].columns[0].setPropertiesSilent({ customAggregate: customAggregateFn });                  
    function customAggregateFn(data) { 
      return data.result.filter(function (item) { 
           return item['ShipCountry'] === 'Brazil'; 

Query2: Is possible to completely customize the groupFooter and/or the captionFooter has a single line ? 
Yes, it’s possible, we have analyzed your requirement and create a sample for your reference, please refer the below sample and documentation link for more information, 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon