Aggregate Sum Header

1 Answer 92 Views
Grid
Nicolas
Top achievements
Rank 1
Iron
Nicolas asked on 10 Oct 2022, 01:01 PM

Hello,

Is it possible to put Aggregate="sum" on the header as on the screenshot below?

I'm able to do it on the footer. I would like to also show it on the header.

Regards,

Nicolas

1 Answer, 1 is accepted

Sort by
0
Doncho
Telerik team
answered on 13 Oct 2022, 10:38 AM

Hi Nicolas,

By default, RadGrid can populate the aggregates of each column only in its footer cell as described in the Aggregates article.

In case the aggregates are crucial for the users you may consider using the StaticHeaders functionality. That way you can define a fixed height of the Grid so that the footer (with the aggregates) and the header are always visible and let the user scroll just the data items between the header and footer. You can test the StaticHeaders in the following live demo:

Find more about the feature in the dedicated documentation articles:

An alternative option could be to use some custom JavaScrpt logic to get the values from the footer cells and populate them in other elements inside or outside the RadGrid.

For example, you can use GridTemplateColumns and define HeaderTemplates with some container elements to be used to display the footer values inside the header. I have attached a sample project with one column header to serve as an idea (add the Telerik.Web.UI.dll in the bin folder to be able to run the sample).

I hope you will find this information helpful.

Please let me know if you have further questions.

Kind regards,
Doncho
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/.

Nicolas
Top achievements
Rank 1
Iron
commented on 18 Oct 2022, 07:44 AM

Hello,

Thank you for your answer how it works

Tags
Grid
Asked by
Nicolas
Top achievements
Rank 1
Iron
Answers by
Doncho
Telerik team
Share this question
or