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

the problem of showing group.key in group footer

3 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 28 Jan 2013, 03:25 PM
I checked the whole forum, didn't find solutions.
I knew it's possible to show the group.key in header, but is it possible to show the group.key in footer?
I tried many ways but failed. Attached is my requirement.

3 Answers, 1 is accepted

Sort by
0
Tony
Top achievements
Rank 1
answered on 28 Jan 2013, 03:45 PM
please view the second attachment , the first is wrong, what i need is to put the grouped country name in the footer.
0
Dimitrina
Telerik team
answered on 28 Jan 2013, 04:21 PM
Hello,

In the GroupFooterTemplate you do not have access to the GroupViewModel but only to the results from the defined AggregateFunction: the Caption, FormattedValue, Value. What you can do is the define a FirstFunction AggregateFunction and then predefine the GroupFooterTemplate like so:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
    <telerik:GridViewDataColumn.GroupFooterTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding FormattedValue.Name}"/>
        </DataTemplate>
    </telerik:GridViewDataColumn.GroupFooterTemplate>
    <telerik:GridViewDataColumn.AggregateFunctions>
        <telerik:FirstFunction/>
    </telerik:GridViewDataColumn.AggregateFunctions>
</telerik:GridViewDataColumn>
 
Will this work for you?

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Tony
Top achievements
Rank 1
answered on 29 Jan 2013, 02:42 AM
it works, thanks.
Tags
GridView
Asked by
Tony
Top achievements
Rank 1
Answers by
Tony
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or