the problem of showing group.key in group footer

4 posts, 0 answers
  1. Tony
    Tony avatar
    6 posts
    Member since:
    Sep 2011

    Posted 28 Jan 2013 Link to this post

    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.
  2. Tony
    Tony avatar
    6 posts
    Member since:
    Sep 2011

    Posted 28 Jan 2013 Link to this post

    please view the second attachment , the first is wrong, what i need is to put the grouped country name in the footer.
  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 Jan 2013 Link to this post

    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.

  4. Tony
    Tony avatar
    6 posts
    Member since:
    Sep 2011

    Posted 28 Jan 2013 Link to this post

    it works, thanks.
Back to Top