[Mono-bugs] [Bug 366566] New: PropertyGrid: Image property un-settable -- maybe all subclass values

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 3 08:48:41 EST 2008


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: contact at i-nz.net
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          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.


More information about the mono-bugs mailing list