[Mono-dev] Object data source update fails on nullable field.

Ivan N. Zlatev contact at i-nz.net
Tue Dec 16 15:57:57 EST 2008


On Tue, Dec 16, 2008 at 8:40 PM, Marek Habersack <mhabersack at novell.com> wrote:
>
> On Tue, 2008-12-16 at 10:29 +0000, Ivan N. Zlatev wrote:
> > 2008/12/16 Vladimir Krasnov <vladimirk at mainsoft.com>
> >         Hi Marek,
> >
> >         I've found some problems in updating row in GridView control
> >         that bound
> >         to ObjectDataSource.
> >
> >         1. ObjectDataSource fails to convert values to Nullable<>
> >         properties
> >         while creating data object.
> >         2. BoundField should return null when no value entered by the
> >         user, it
> >         returns empty string and ObjectDataSource fails to convert it.
> >
> >         Please review attached patch that fixes both these problems,
> >         also find
> >         attached test cases.
> >
> >         Vladimir
> >
> >
> > I don't know if the web databinding layer uses TypeConverters (the
> > WinForms one does), but just in case I should note that I have
> > implemented the NullableConverter two weeks ago in SVN HEAD.
> It does, when the type being converted is adorned with the TypeConverter
> attribute


A type doesn't necessarily have to have a TypeConverterAttribute
attached. There is a table of predefined converters in TypeDescriptor
that it always falls back to. In addition TypeConverters can be fed
via TypeDescriptionProvider-s added to the TypeDescriptor.

--
Kind Regards,
Ivan N. Zlatev


More information about the Mono-devel-list mailing list