Attached to my reply, you will find a runnable example demonstrating how we can add a footer template that sums the data of a given Grid column. Here is the used Grid definition:
With the code in yellow, we define the FooterTemplate of the "Freight" column. With the code in green, we define the "sum" aggregate for the "Freight" column.
In the attached example, the "sum" displayed in the footer template is the sum of all fields in the "Freight" column. If you want to display only the sum of the fields that are loaded in the current Grid page, you can check this SO thread.
I hope the provided example will help you implement the targeted functionality in the application you are working on.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
This is not working when a row contains a null value
Mihaela
Telerik team
commented on 01 Apr 2024, 11:15 AM
Hi Stefan,
Would you check data type of the Model property, which aggregate is displayed within the Grid footer? The default value of the integral numeric and floating-point numeric types (i.e., integer, double, decimal, etc.) is 0 (zero).
I have tested the "Freight" property, which data type is decimal, and it appears that the "sum" aggregate is correct: