https://bugzilla.novell.com/show_bug.cgi?id=366566


           Summary: PropertyGrid: Image property un-settable -- maybe all
                    subclass values
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


A property of type Image is un-settable: the UI editor appears, an image file
can be selected, but the property retains its previous value.  This occurs
whether the existing value was null or not.  

Debugging shows that the UI editor (ImageEditor.EditValue) returns a Bitmap
(for my test file).  Note that Bitmap is a subclass of abstract class Image. 
ImageTypeConverter.CanConvertFrom returns false for typeof(Image) and
typeof(Bitmap), so(?) setting a value of type Bitmap on a property of type
Image must be valid directly.

Thus, should the check in GridEntry.SetValueCore whether the value needs
conversion be:
   if (!this.PropertyDescriptor.PropertyType
         .IsAssignableFrom(valueType)) {
instead of the current:
   if (valueType != this.PropertyDescriptor.PropertyType) {

(Of, maybe its that even if using the TypeConverter fails then
PropertyDescriptor.SetValue should be attempted anyway?  Hmm less likely).


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to