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

NestedProperties not working with ICustomTypeProvider

2 Answers 50 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Wenhao
Top achievements
Rank 1
Wenhao asked on 28 Nov 2012, 02:50 AM
Hello Telerik,

Recently we upgraded the RadControls library to version 2012.2.724.1050, but we noticed that the nested properties now does not work well when we bind a custom object with ICustomTypeProvider implemented.

As I know, an old version of the RadPropertyGrid could do well with the same code, and that's right what we did as before. But now it doesn't. Please help as it's very urgent and important for us.

Thanks,
Wenhao

2 Answers, 1 is accepted

Sort by
0
Wenhao
Top achievements
Rank 1
answered on 10 Dec 2012, 08:49 AM
Finally we debuged into your source code, and worked it out now. So, the code below could be the cause of this issue.

In the get stub of the class PropertyGridField's property CurrentContextPropertyValue, I noticed that you retrieve the PropertyInfo via the following code:

PropertyInfo pi = value.GetType().GetProperty(propertyDefiniton.Binding.Path.Path); 

However, if the value object is an ICustomTypeProvider, the GetType method would just return null, and the nested properties will never show up in PropertyGrid. Somehow,  you have another extension method called "GetCustomTypeFromCustomTypeProvider", that would be the answer to ICustomTypeProvider. So, I switched it as:

PropertyInfo pi = value.GetCustomTypeFromCustomTypeProvider().GetProperty(propertyDefiniton.Binding.Path.Path);

The PropertyGrid now woks great~ So hope this could do some help to someone else with the same issue, and maybe you could forward to your dev team.

Thanks,
Wenhao



0
Ivan Ivanov
Telerik team
answered on 10 Dec 2012, 08:59 AM
Hello Wenhao,

Thank you for the provided feedback and the proposed workaround. Currently, we cannot officially claim that ICustomTypeProvider is supported by RadPropertyGrid out of the box. However, we will put this on the top of our priority list. Meanwhile, I have updated your Telerik points status by adding 1000 points in accordance to your report and your invested effort for finding a workaround. I will come back to you as soon as we are ready with this feature.

Greetings,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PropertyGrid
Asked by
Wenhao
Top achievements
Rank 1
Answers by
Wenhao
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or