This is a migrated thread and some comments may be shown as answers.

Change grid column to affect sum - custom aggregate

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 01 Dec 2020, 08:37 PM

     In itemDataBound I am conditionally changing an integer column, but the sum aggregate footer reflects the original values from the query. How do I get the changed value reflected in the sum?

 

2 Answers, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 04 Dec 2020, 09:50 AM

Hi David,

When a certain data is bound to RadGrid rows, that data will be processed later to calculate aggregate values as well. By changing the Text property of a Cell will not be bound to the Cell nor will be included in the aggregate values. It is like changing a variable name will not change the value assigned to it.

Having that in mind, if you are manually changing the data, you might as well update the aggregate values manually.

I happen to have an example of manipulating the aggregates by calculating only selected rows' values. Check and download the attachment.

In your case, you will need to update the aggregate values similar to the example. 

I hope this will prove helpful.

Regards,
Attila Antal
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/.

0
david
Top achievements
Rank 1
answered on 04 Dec 2020, 03:15 PM
Thanks!
Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
david
Top achievements
Rank 1
Share this question
or