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

Sorting on Sub Property

5 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Albert Shenker asked on 13 Sep 2008, 04:17 PM
I have a custom object "Person", which has a property "Address", which in turn has a property "City". I bind a grid to a collection of "Person" and have a column for City. I would like to be able to sort by City, but if I try, I get an error stating that the Column "City" cannot be found. I assume this is because the "Person" object doesn't have a property named "City". I can, of course, create a readonly property named City for the Person, but this would pretty much eliminate the purpose of binding to the custom type (as oposed to a dataview, or something along those lines). Is there any way to acoomplish what I am trying to do?

5 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Sep 2008, 09:21 AM
Hello Albert,

I tested the control with a similar setup, and it behaved as expected.
Attached to this message, you will find the code which I used for testing.
Let me know if I am leaving something out.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Albert Shenker
Top achievements
Rank 1
Veteran
answered on 16 Sep 2008, 04:56 PM
Wow, I didn't realize you could use dot (.) notation in the uniquename or datafield properties. Is there some documentation of this?
0
Yavor
Telerik team
answered on 17 Sep 2008, 05:49 AM
Hi Albert,

To see more information on the suggested approach, please refer to the following article.
I hope this helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Albert Shenker
Top achievements
Rank 1
Veteran
answered on 17 Sep 2008, 02:47 PM
Thanks!
0
Albert Shenker
Top achievements
Rank 1
Veteran
answered on 17 Sep 2008, 02:47 PM
Thanks!
Tags
Grid
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Answers by
Yavor
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Share this question
or