K
Keith Degrace
I am having a bit of a problem with the PropertyGrid.
I've search all over and haven't found my answer yet...
Here's the scenario...
I have the following classes...
Control: Abstract class that represents a control. I
have concrete classes that derive this class for all
typical types of controls. (Button, ListBox, ect..)
ControlCollection: A collection of Control objects.
Window: Typical window. It has a ControlCollection
member that holds all the concrete controls of this
window.
I have all this setup to be browsable in a PropertyGrid
and everything works great except for one minor thing...
When I open up the CollectionEditor for the Controls
property of my window and click the 'Add' button, I get
the expected error that it can't create an instance of
the abstract class Control.
Is it possible to somehow override that 'Add' button to
maybe display a dialog where the user would be able to
choose what type of Control that will be added? or maybe
even completly removing the 'Add' and 'Remove' buttons
altogether?
Thanks in advance,
Keith Degrace
I've search all over and haven't found my answer yet...
Here's the scenario...
I have the following classes...
Control: Abstract class that represents a control. I
have concrete classes that derive this class for all
typical types of controls. (Button, ListBox, ect..)
ControlCollection: A collection of Control objects.
Window: Typical window. It has a ControlCollection
member that holds all the concrete controls of this
window.
I have all this setup to be browsable in a PropertyGrid
and everything works great except for one minor thing...
When I open up the CollectionEditor for the Controls
property of my window and click the 'Add' button, I get
the expected error that it can't create an instance of
the abstract class Control.
Is it possible to somehow override that 'Add' button to
maybe display a dialog where the user would be able to
choose what type of Control that will be added? or maybe
even completly removing the 'Add' and 'Remove' buttons
altogether?
Thanks in advance,
Keith Degrace