Manually Creating NestedProperties

3 posts, 0 answers
  1. Bob
    Bob avatar
    2 posts
    Member since:
    Nov 2010

    Posted 31 May 2012 Link to this post

    I am trying to create nested properties manually from code for a property grid.  I have an example solution that uses the same sample data used for the NestedProperties demo application.  The sample solution can be downloaded here.  When adding the PropertyDefintion's that should be nested to the NestedProperties the parent PropertyDefinition in the property grid does not show a + sign to indicate it has nested properties.
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 01 Jun 2012 Link to this post

    Hi,

    With the current version of RadPropertyGrid, only PropertyDefinitions that have a properly set Binding property can have nested PropertyDefinitions. However, as this has proved to be quite a limitation in certain scenarios, we are up to introduce a unbound mode for RadPropertyGrid with our incoming Q2 (a couple of weeks) release that will let users define their own hierarchies, without any dependencies between parent/child or sibling nodes. As a side note, please let me add that instead of loading DataTemplates from xaml string, you can utilize our AutoBind attached behavior that will let you reuse a DataTemplate definitions for multiple PropertyDefinitions. I am attaching a updated version of your project, having the issue fixed.

    All the best,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Bob
    Bob avatar
    2 posts
    Member since:
    Nov 2010

    Posted 01 Jun 2012 Link to this post

    Ivan,
    Thank you for your prompt response.  Looking forward to the next release.  I am aware of the AutoBind attached behavior.  I was just using the example data to make for a simple example.  We are actually working with dynamic property collections instead of a fixed property set for a concrete class.  We have a solution for a question in this forum regarding the PropertyGrid and MVVM.  I just haven't got around to creating a simple example of the methodology to post.  There were a couple of cruxes.  One was with creating the data templates using Xaml.  It appears there is still an issue with memory leaks when creating inline data templates.  There was a need to cache them as they were created and repurpose them with each update of the property collection being displayed.  Otherwise they were not being garbage collected when clearing the property definitions on the property grid.
Back to Top