
I'm trying to solve a problem. I have a property grid that is showing the properties of an object in our view model. One of these properties is initially null. In the editor for the property, the user can choose from a number of class types that derive from a base type (the property type). When the user selects the derived type they want, we create an object of the derived type and then set the property value for the data accessor to the new property value.
The problem is that the data accessor type is set to the base type (which it gets from the object), so we only see the base class properties for the new object in the property grid. The ValueType field on PropertyGridDataAccessorItem is readonly, so it can't be changed to be the derived type. How can I update the PropertyGridDataAccessorItem passed in to class so it shows the property value for the derived type we assign? Can I set/call something on it to update or alternatively replace it with a new PropertyGridDataAccessorItem that for the derived type?
Thanks,
Max
The problem is that the data accessor type is set to the base type (which it gets from the object), so we only see the base class properties for the new object in the property grid. The ValueType field on PropertyGridDataAccessorItem is readonly, so it can't be changed to be the derived type. How can I update the PropertyGridDataAccessorItem passed in to class so it shows the property value for the derived type we assign? Can I set/call something on it to update or alternatively replace it with a new PropertyGridDataAccessorItem that for the derived type?
Thanks,
Max