+2008-08-07 Ivan N. Zlatev <contact@i-nz.net>
+
+ * GridEntry.cs: Check if current property is a ICustomTypeDescriptor
+ and not the parent one (the propertyowner). Fixes the behavior of
+ GetConverter/GetEditor.
+ [Fixes bug #415452]
+
2008-08-07 Ivan N. Zlatev <contact@i-nz.net>
* PropertyGrid.cs: Refresh should also repopulate the PropertyGrid.
if (PropertyDescriptor != null) {
try { // can happen, because we are missing some editors
UITypeEditor editor = null;
- if (PropertyOwner is ICustomTypeDescriptor)
- editor = (UITypeEditor) ((ICustomTypeDescriptor)PropertyOwner).GetEditor (typeof (UITypeEditor));
+ ICustomTypeDescriptor customDescriptor = this.Value as ICustomTypeDescriptor;
+ if (customDescriptor != null)
+ editor = (UITypeEditor) customDescriptor.GetEditor (typeof (UITypeEditor));
if (editor == null)
editor = (UITypeEditor) PropertyDescriptor.GetEditor (typeof (UITypeEditor));
return editor;
private TypeConverter GetConverter ()
{
TypeConverter converter = null;
- if (PropertyOwner is ICustomTypeDescriptor)
- converter = ((ICustomTypeDescriptor)PropertyOwner).GetConverter ();
+ ICustomTypeDescriptor customDescriptor = this.Value as ICustomTypeDescriptor;
+ if (customDescriptor != null)
+ converter = customDescriptor.GetConverter ();
if (converter == null && PropertyDescriptor != null)
converter = PropertyDescriptor.Converter;
return converter;