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

Binding PropertyGrid.Item to ExpandoObject

1 Answer 187 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Roar
Top achievements
Rank 1
Roar asked on 30 May 2013, 09:13 AM
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?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 30 May 2013, 10:55 AM
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. 

Regards,
Maya
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PropertyGrid
Asked by
Roar
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or