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

AggregateFunction Caption in footer and group bar

4 Answers 218 Views
GridView
This is a migrated thread and some comments may be shown as answers.
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!

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 17 Aug 2010, 03:06 PM
Hi Geoff Smith,

You can use the properties of the grid ShowColumnFooters and ShowGroupFooters and set them to True/False depending on your requirements.
 

Sincerely yours,
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:

<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
Maya
Telerik team
answered on 17 Aug 2010, 03:56 PM
Hi Geoff Smith,

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.


Regards,
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 :)
Tags
GridView
Asked by
Geoff Smith
Top achievements
Rank 1
Answers by
Maya
Telerik team
Geoff Smith
Top achievements
Rank 1
Share this question
or