R
rb
Hi,
I extended one of the standard controls by adding a new property, which is
also a class itself. I got everything going nicely in PropertyGrid except
for 2 things:
1. As soon as I drop this control on a form, the subclass-property doesn't
get instantiated as expected. For example, the Size property is normally
initiated as TheControl.Size = new System.Drawing.Size( xx, yy). My property
is initalized as follows:
MyProp prop1 = new MyPropType();
TheControl.MyProp = prop1;
prop1.MinValue = xx;
prop2.MaxValue = yy;
Seems that this happens because I use a default constructor ( MyProp() ).
However, if I remove the default constructor and leave only MyProp( min,
max ), I still don't get TheControl.MyProp = new MyProp and changes in
PropertyGrid don't persist.
2. Is there any way to order subclass properties when they're expanded in
PropertyGrid? I have MinValue and MaxValue properties but Max always comes
above Min (alpha sort order).
Thanks a lot.
rb
I extended one of the standard controls by adding a new property, which is
also a class itself. I got everything going nicely in PropertyGrid except
for 2 things:
1. As soon as I drop this control on a form, the subclass-property doesn't
get instantiated as expected. For example, the Size property is normally
initiated as TheControl.Size = new System.Drawing.Size( xx, yy). My property
is initalized as follows:
MyProp prop1 = new MyPropType();
TheControl.MyProp = prop1;
prop1.MinValue = xx;
prop2.MaxValue = yy;
Seems that this happens because I use a default constructor ( MyProp() ).
However, if I remove the default constructor and leave only MyProp( min,
max ), I still don't get TheControl.MyProp = new MyProp and changes in
PropertyGrid don't persist.
2. Is there any way to order subclass properties when they're expanded in
PropertyGrid? I have MinValue and MaxValue properties but Max always comes
above Min (alpha sort order).
Thanks a lot.
rb