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

Gridview grouping - group by id, but display name in group header

1 Answer 207 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 30 May 2012, 03:32 PM
Greetings,

Probably a trivial task, but I can't seem to gleam how to do this from the documentation.   One of the columns for my gridview is bound to a business object which has an ID and a Name property. 

It groups just fine by this column when I do: GroupMemberPath="Foo.Id", however this puts the Id in the group header.  If I group by Foo.Name, that makes the header look accurate - however this is technically incorrect.

The ideal behavior is to group by id, but display the name in the row group header.   I have tried using the GroupHeaderTemplate, however its Group.Key only seems to contain the column which has been grouped by.   Is there any way to group by the entire entity?  What's the recommended way to handle this?

Thanks,
Shaun

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 30 May 2012, 03:41 PM
Hello,

 You could use a generic GroupDescriptor. I would recommend you to go through this forum thread for an example.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Shaun
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or