C
Claus Christiansen
Hi,
I've made a class containing a public int and a public Point. I also
created a TypeConverter (in fact an ExpandableObjectConverter) supporting
InstanceDescriptorInfo.
This results in a nice expandable property containing the integer
property and an expandable Point property. So far so good.
Further I've found out that in order to inform my control that a sub-
property has been changed then I have to override
GetCreateInstanceSupported and CreateInstance. Now the control catches
the updates.
However:
If I expand the property in the PropertyBrowser like this:
-MyClassProp
- PointProp
X
Y
IntProp
and then enter a new X value and press Enter then the PropertyGrid
somehow gets confused and displays something like this:
-MyClassProp
+ PointProp
IntProp
Y
IntProp
Ie. the Point-property is collapsed but still partially drawn as
expanded! Collapsing and expanding the MyClassProp updates the
PropertyGrid.
My implementation of CreateInstance is pretty simple:
public override object CreateInstance(ITypeDescriptorContext Context,
System.Collections.IDictionary PropertyValues)
{
Point p = (Point)PropertyValues["PointProp"];
MyClassProp mcp = new MyClassProp((int)PropertyValues["IntProp"], p);
return mcp;
}
What am I doing wrong? Or is this a bug in the PropertyGrid?
Regards
/Claus
I've made a class containing a public int and a public Point. I also
created a TypeConverter (in fact an ExpandableObjectConverter) supporting
InstanceDescriptorInfo.
This results in a nice expandable property containing the integer
property and an expandable Point property. So far so good.
Further I've found out that in order to inform my control that a sub-
property has been changed then I have to override
GetCreateInstanceSupported and CreateInstance. Now the control catches
the updates.
However:
If I expand the property in the PropertyBrowser like this:
-MyClassProp
- PointProp
X
Y
IntProp
and then enter a new X value and press Enter then the PropertyGrid
somehow gets confused and displays something like this:
-MyClassProp
+ PointProp
IntProp
Y
IntProp
Ie. the Point-property is collapsed but still partially drawn as
expanded! Collapsing and expanding the MyClassProp updates the
PropertyGrid.
My implementation of CreateInstance is pretty simple:
public override object CreateInstance(ITypeDescriptorContext Context,
System.Collections.IDictionary PropertyValues)
{
Point p = (Point)PropertyValues["PointProp"];
MyClassProp mcp = new MyClassProp((int)PropertyValues["IntProp"], p);
return mcp;
}
What am I doing wrong? Or is this a bug in the PropertyGrid?
Regards
/Claus