I'm using the RadTreeViewList control and i was to display aggregated values at the footer.
My Data has infinite number of levels. My items source is an observable collection of Tasks. Where a task has collection called Children tasks.
I have added aggregate functions in some of the columns like this:
<
telerik:GridViewDataColumn
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding BudgetHours, Mode=OneWay}"
Header
=
"Budget Hours"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
"Total: "
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
But the problem with this is that it will sum the values at the root level and not add from the children tasks.
Is there an elegant soultion for this ?
Thanks,
Abdul
5 Answers, 1 is accepted
For the time being the aggregates are applied only at the root level. However, we have logged it as a feature request into our Public Issue Tracking System. I would encourage you to vote for it as the higher its rating is, the more important and with higher priority it gets.
Maya
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
thank you for your quick reply. I have already voted for the issue in PITS.
I was thinking of implementing a custom filter that will recursively sum values from child collections. However since i have different columns to sum i will have to write a separate fuction for each. Is there a way to pass the name of the column to the aggregate function so i can use Reflection to sum the values from the named property ? .
i.e. im looking for something like a converter parameter that will pass the property name to the custom aggegate function.
Thanks,
Abdul
Generally, you may find the name of the column using its UniqueName property. Another possible approach would be to get the name of the underlying property:
string propertyName = ((GridViewDataColumn)this.myGrid.Columns[1]).DataMemberBinding.Path.Path;
Maya
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
I need the opposite - to show totals for top-level items only. Is there now a way to configure TreeListView (or aggregate function) to do this?
Thanks.
Such scenario is currently not supported out-of-the-box. You need to create custom aggregate function that will calculate only the root items. Check out this and this demos for a reference.
Greetings,
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.