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

Displaying Group name in Column GroupFooter

2 Answers 140 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lakshmanarajan
Top achievements
Rank 1
Lakshmanarajan asked on 04 Jun 2013, 12:24 PM
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 Answers, 1 is accepted

Sort by
0
Lakshmanarajan
Top achievements
Rank 1
answered on 05 Jun 2013, 05:37 AM
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.

0
Yoan
Telerik team
answered on 07 Jun 2013, 12:31 PM
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.

Tags
GridView
Asked by
Lakshmanarajan
Top achievements
Rank 1
Answers by
Lakshmanarajan
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or