NestedProperties not working with ICustomTypeProvider

3 posts, 0 answers
  1. Wenhao
    Wenhao avatar
    17 posts
    Member since:
    Jan 2012

    Posted 27 Nov 2012 Link to this post

    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. Wenhao
    Wenhao avatar
    17 posts
    Member since:
    Jan 2012

    Posted 10 Dec 2012 Link to this post

    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



  3. DevCraft banner
  4. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 10 Dec 2012 Link to this post

    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.

Back to Top