G
Guest
I'm Using the PropertyGrid Contol , and have a requirement to display a
localized property name.
Therefore My Classes Implement ICustomTypeDescriptor, and return a custom
PropertyDescriptor Collection,
The issues is that in the Derived PropertyDescriptor object when overriding
the "DisplayName" property it causes the PropertyGrid to call the
"DisplayName" Property an inordinate number of times, which then makes the
PropertyGrid, very slow and unusable.
code Snippet
ICustomTypeDescriptor.
public PropertyDescriptorCollection GetProperties(Attribute[] attributes) {
..Returns new PropertyDescriptorCollection containing MyPropertyDescriptor
objects
}
public class MyPropertyDescriptor : PropertyDescriptor
public override string DisplayName {
get{return "Overriden DisplayName"}
}
Worth mentioning, if I comment out the DisplayName Override Property
And run the code, then the grid functions as usual?
Any one have any idea's why DisplayName gets called again and again, and how
to prevent it?
Cheers
Brett
localized property name.
Therefore My Classes Implement ICustomTypeDescriptor, and return a custom
PropertyDescriptor Collection,
The issues is that in the Derived PropertyDescriptor object when overriding
the "DisplayName" property it causes the PropertyGrid to call the
"DisplayName" Property an inordinate number of times, which then makes the
PropertyGrid, very slow and unusable.
code Snippet
ICustomTypeDescriptor.
public PropertyDescriptorCollection GetProperties(Attribute[] attributes) {
..Returns new PropertyDescriptorCollection containing MyPropertyDescriptor
objects
}
public class MyPropertyDescriptor : PropertyDescriptor
public override string DisplayName {
get{return "Overriden DisplayName"}
}
Worth mentioning, if I comment out the DisplayName Override Property
And run the code, then the grid functions as usual?
Any one have any idea's why DisplayName gets called again and again, and how
to prevent it?
Cheers
Brett