Geoff Smith
Top achievements
Rank 1
Geoff Smith
asked on 17 Aug 2010, 02:59 PM
Is there a straightforward way of hiding the caption of an aggregate function in the footer while showing it in the group header? I'm looking into the footer template now to see how its put together, but was wondering if I'm missing a simple trick...
Thanks!
Thanks!
4 Answers, 1 is accepted
0
Hi Geoff Smith,
Maya
the Telerik team
You can use the properties of the grid ShowColumnFooters and ShowGroupFooters and set them to True/False depending on your requirements.
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Geoff Smith
Top achievements
Rank 1
answered on 17 Aug 2010, 03:11 PM
Apologies, I don't think my question was very clear. I have a GridViewDataColumn with a AggregateFunctions set like:
Now that Caption will show in both the group footer and the group row. What I'm trying to achieve is to only show "Total:" in the group row. It is redundent to show it in the group footer because we already know what it is from the column header...
<
SumFunction
Caption
=
"Total: "
ResultFormatString
=
"{}{0:N0}"
/>
Now that Caption will show in both the group footer and the group row. What I'm trying to achieve is to only show "Total:" in the group row. It is redundent to show it in the group footer because we already know what it is from the column header...
0
Accepted
Hi Geoff Smith,
You may find an additional example for this approach in our demos.
Maya
the Telerik team
What you can do in this case is to predefine the GroupFooterTemplate of the column showing the Aggregate Results in the footer. So, for example its definition may be as follows:
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Number}"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
"Sum: "
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:GridViewColumn.GroupFooterTemplate
>
<
DataTemplate
>
<
telerik:AggregateResultsList
ItemsSource
=
"{Binding}"
>
<
telerik:AggregateResultsList.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding FormattedValue}"
/>
</
DataTemplate
>
</
telerik:AggregateResultsList.ItemTemplate
>
</
telerik:AggregateResultsList
>
</
DataTemplate
>
</
telerik:GridViewColumn.GroupFooterTemplate
>
</
telerik:GridViewDataColumn
>
You may find an additional example for this approach in our demos.
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Geoff Smith
Top achievements
Rank 1
answered on 17 Aug 2010, 03:58 PM
Ah cool, thanks for that :)