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

[Solved] FieldDescriptorNamePair custom relation

2 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Juan Esteban Giraldo Gómez
Top achievements
Rank 1
Juan Esteban Giraldo Gómez asked on 18 Oct 2009, 01:10 PM
Hi,how are you?
I'm trying to establish a relation beetween two classes by using a property of a class. The problem is that the property that I need as the key of the relation, is not a property of the class that I'm using in the relation. Otherwise the property that I need, is a child of one of the properties that I have in the class. I'm going to give an example:

This works great:

relation.FieldNames.Add(

new FieldDescriptorNamePair("IdComponent", "IdComponent"));

But when I need this, It's not working:
relation.FieldNames.Add(new FieldDescriptorNamePair("IdComponent", "Requirement.IdComponent"));

How can I get this functionality?

Thanks a lot

Juan Giraldo...

 

2 Answers, 1 is accepted

Sort by
0
Juan Esteban Giraldo Gómez
Top achievements
Rank 1
answered on 20 Oct 2009, 11:31 AM

Hi, Who can I help me with this issue? I have tried to solve this problem a long time, but I can't find an answer. I appreciate any help or suggestion about this problem.

Thanks...

0
Rossen Hristov
Telerik team
answered on 21 Oct 2009, 09:09 AM
Hi Juan Esteban Giraldo Gómez,

Currently, nested properties are not supported for FieldDescriptorNamePair. You will have to add a shortcut property to your child class which will return Requirement.IdComponent and it will work as expected.

If the business object classed are not "yours", you will have to create a ViewModel (wrappers) around the business object classes and bind the grid to this ViewModel.

I hope this helps.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Juan Esteban Giraldo Gómez
Top achievements
Rank 1
Answers by
Juan Esteban Giraldo Gómez
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or