Binding PropertyGrid.Item to ExpandoObject

2 posts, 0 answers
  1. Roar
    Roar avatar
    9 posts
    Member since:
    Jul 2012

    Posted 30 May 2013 Link to this post

    I have a TreeView where the user can select any Item. The selected Item have a property which is of type ExpandoObject.
    Then I have a PropertyGrid where I bind the PropertyGrid.Item to the ExpandoObject. This all works fine, when the user select an Item in the TreeView, the PropertyGrid will show all properties for the selected Item's dynamic properties. But all fields in the ExpandoObject is displayed with a TextBox (or CheckBox for booleans) in the PropertyGrid. The ExpandoObject can have properies of different types: strings, integers, decimals, booleans and sometimes I will need to have a dropdown list to select one value. How can get the PropertyGrid to display the proper editor based on the type of the property?

  2. Maya
    Maya avatar
    4062 posts

    Posted 30 May 2013 Link to this post

    Hello Roar,

    You can try handling AutoGeneratingPropertyDefinition and assing an EditorTemplate with the editor you require for each property definition. Check out this article for more information.
    Let me know in case you need further assistance. 


    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top