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

GroupDescriptor and IComparable

3 Answers 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 03 Oct 2011, 09:50 PM
I need to group a property that does not implement IComparable. I'd expect it to simply do a ReferenceEquals. It's not. It's erroring.

I cannot alter the class being grouped without serious effort, it's a WCF Data Services entity (they do not implement IComparable).

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 06 Oct 2011, 04:37 PM
Hi Jerome,

Indeed RadGridView cannot group by a property which doesn't implement IEquatable<T> or IComparable interfaces. However you could set GroupMemberPath and point RadGridView to group by a property of the WCF Data service entity which implements IComparable interface. For example GroupMemberPath = "Entity.ID".

Let me know if this doesn't help.

Regards,
Nedyalko Nikolov
the Telerik team

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

0
Jerome
Top achievements
Rank 1
answered on 06 Oct 2011, 04:39 PM
Okay, but then Group.Key refers to the key. There's no way to navigate from there up to the actual grouped value, so that I can use other properties of it in rendering it's header.
0
Vlad
Telerik team
answered on 11 Oct 2011, 12:46 PM
Hi,

 Generally WCF Data Services classes are partial and you can implement IComparable very easily. 

Greetings,
Vlad
the Telerik team

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

Tags
GridView
Asked by
Jerome
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Jerome
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or