PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
PropertyGrid not updating correctly
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
PropertyGrid not updating correctly
![]() |
PropertyGrid not updating correctly |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi,
try to put this attribute to both properties: [RefreshProperties(RefreshProperties.All)] This should force the properties to be requeried and the view redrawn... regards, iulian |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

