[Mono-winforms-list] Using PropertyGrid with UITypeEditor

Rolf Bjarne Kvinge rolflists at ya.com
Thu Jul 12 12:44:19 EDT 2007



> -----Original Message-----
> From: mono-winforms-list-bounces at lists.ximian.com [mailto:mono-
> winforms-list-bounces at lists.ximian.com] On Behalf Of Rolf Bjarne Kvinge
> Sent: miércoles, 11 de julio de 2007 11:20
> To: 'Mike Deskevich'; mono-winforms-list at lists.ximian.com
> Subject: Re: [Mono-winforms-list] Using PropertyGrid with UITypeEditor
> 
> 
> 
> > -----Original Message-----
> > From: mono-winforms-list-bounces at lists.ximian.com [mailto:mono-
> > winforms-list-bounces at lists.ximian.com] On Behalf Of Mike Deskevich
> > Sent: domingo, 24 de junio de 2007 21:02
> > To: mono-winforms-list at lists.ximian.com
> > Subject: [Mono-winforms-list] Using PropertyGrid with UITypeEditor
> >
> > I'm having a problem that I can't seem to figure out.  I created a
> > class that has a public property with an array of enums.  I would
> like
> > to have an Editor that allows the user select 0 or more enums to
> > populate this array.  My problem is that the PropertyGrid won't
> > display either the elipses or the dropdown button for me.
> >
> > Below is an example of the how I have the classes set up.  When i
> > create a PropertyGrid and set the SelectedObject to an instance of
> > ClassToEdit all the properties show up how they're supposed to except
> > for the array of MyEnum.
> >
> > Any hints?  I've looked through the MSDN and it looks like I'm
> > implementing this just like all of the examples.
> >
> 
> This looks like a bug, please file a report here:
> http://bugzilla.ximian.com
> 

It was a bug, it should now be fixed.

Rolf

> Rolf
> 
> > public class ClassToEdit
> > {
> >    //didn't copy the other simple properties here
> >
> >    //here's my custom type
> >    MyEnum[] m_enums;
> >    [Editor(typeof(MyEnumArrayEditor),typeof(UITypeEditor))]
> >    property MyEnum[] enums
> >    {
> >       get
> >       {
> >          return m_enums;
> >        }
> >        set
> >        {
> >           m_enums=value;
> >        }
> >    }
> > }
> >
> > public class MyEnumArrayEdior : UITypeEditor
> >   {
> >     private IWindowsFormsEditorService edSvc;
> >
> >     public override UITypeEditorEditStyle
> > GetEditStyle(ITypeDescriptorContext context)
> >     {
> >        return UITypeEditorEditStyle.DropDown;
> >     }
> >
> >     public override Object EditValue(ITypeDescriptorContext context,
> > IServiceProvider provider, Object value)
> >     {
> >         //populate the combo box and stuff here
> >     }
> >   }
> > _______________________________________________
> > Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.476 / Virus Database: 269.10.0/887 - Release Date:
> > 05/07/2007 13:55
> 
> 
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.476 / Virus Database: 269.10.2/893 - Release Date:
> 09/07/2007 17:22




More information about the Mono-winforms-list mailing list