
Say I have a property called and typed Shape. Is there a way to load a dropdown or popup list with subclasses like Box, Triangle, Square, etc? And when selected, will I be able to expand custom properties added to those subclasses?
Thanks
Say I have a property called and typed Shape. Is there a way to load a dropdown or popup list with subclasses like Box, Triangle, Square, etc? And when selected, will I be able to expand custom properties added to those subclasses?
Thanks
Hi Todd,
Yes, that would be possible. The expansion is generally the easy part, as you just need to mark your objects as being expandable. We do this in our samples like so:
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ChildObject : BaseObject {
// ...
}
But there are other ways to mark it as expandable, if you are not able to modify the class definition.
As for making a set of predefined values, that is also possible. In PropertyGrid terms, those are called "standard values" (Microsoft's term). These are also typicaly defined using a TypeConverter. You would need to:
Please log in to a validated account to post comments.