# RadGrid, use calculated fields in group and grand footers

1. ##### Robert
1 posts
Member since:
May 2012

Posted 16 May 2012 Link to this post

I’m using a radgrid with boundcolumns, some of the columns are displayed as percentages.  How would I display percentages in the group footer and the grand total footer?   It's easy to sum, count fields in footers but I'm stumped with how to create calculated fields in footers.

The percentage would be calculated by sum of one column divided by the other.  I looked at the example that uses the CustomAggregates event but if I used that then it would have to create a datatable for every percentage column for every group which would be significant overhead.

Let me know if you have any suggestions.

Thanks,

Bob

2. ##### Brian
1 posts
Member since:
Dec 2010

Posted 16 Aug 2012 Link to this post

Did anyone ever respond to this inquiry? I have the same question.
3. ##### Marin
1057 posts

Posted 21 Aug 2012 Link to this post

Hi,

You can use the GridCalculatedColumn as shown in this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/groupfooter/defaultcs.aspx

All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
4. ##### Daniel
1 posts
Member since:
Oct 2016

Posted 11 Oct 2016 in reply to Marin Link to this post

GridCalculatedColumn does not provide a proper calculation for percentages of an aggregate footer row.

For example, I have 4 rows of percentages (0%, 50%, 100%, 100%) calculated from Row1 / TotalsColumn, and the footer row percentage shows up as 250% if I set the property Aggregate="Sum".

The Row1 values (0,1,1,3) total to 5, the TotalsColumn values (1,2,1,3) total to 7. This calculates to 71.43%.

5. ##### Marin
1057 posts

Posted 12 Oct 2016 Link to this post

Hello,

You can use custom aggregates to calculate the required value as shown in this help article:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/totals-in-grid-footers

Regards,
Marin
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
3 posts
Member since:
Mar 2014

Can anyone please post appropriate solution here for aggregating a percentage column?
7. ##### Eyup
3215 posts

Posted 07 Jun Link to this post

`<``telerik:GridNumericColumn ``... ``DataFormatString``=``"{0:P}"`  `Aggregate``=``"Avg"``>`