Displaying Group name in Column GroupFooter

3 posts, 0 answers
  1. Lakshmanarajan
    Lakshmanarajan avatar
    2 posts
    Member since:
    Jun 2013

    Posted 04 Jun 2013 Link to this post

    Hi Telerik Team,

    I want to show the group name in the Column Group footer. The scenario goes like this, I have grouped using two columns namely Country and State.

    In the State Column footer, which is a inner group, I want to show the State name of that group.
    The outer group is Country, I want to show the outer group's name in the footer of State column.

    Please refer the attached image for better understanding.

    Thanks in advance,
    Lakshman


  2. Lakshmanarajan
    Lakshmanarajan avatar
    2 posts
    Member since:
    Jun 2013

    Posted 05 Jun 2013 Link to this post

    And I had seen this link, which solves only if there is only one level of grouping.
    http://www.telerik.com/community/forums/silverlight/gridview/the-problem-of-showing-group-key-in-group-footer.aspx

    But in my case I needed for the two levels of grouping.

  3. Yoan
    Admin
    Yoan avatar
    1159 posts

    Posted 07 Jun 2013 Link to this post

    Hello Lakshman,

    In order to achieve your goal, you can predefine the GroupFooterTemplate like so:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
                        <telerik:GridViewDataColumn.GroupFooterTemplate>
                             <DataTemplate>                      
                                <TextBlock Text="{Binding Path=Group.Key,RelativeSource={RelativeSource FindAncestor,AncestorType=telerik:GridViewGroupFooterRow}}"/>
                            </DataTemplate
                        </telerik:GridViewDataColumn.GroupFooterTemplate>     </telerik:GridViewDataColumn>

    For your convenience, I have prepared a sample project that meets your requirements. Please find it attached.

    Regards,
    Yoan
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top