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?
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?