Home All Groups Group Topic Archive Search About

GridView w/ ObjectDataSource change null integer into zeros

Author
27 Mar 2006 5:12 AM
Rachel
Hi,

I currently have a custom GridView control bound to a ObjectDataSource
(business objects)

When calling the "ObjectDataSourceView.insert(...)" and
"ObjectDataSourceView.update(...)", EMPTY grid fields corresponding to
INTEGERS are saved as 0 (ZERO) instead of nothing!

for instance, I have a business object "StandardDetail" with a
"standardNumber" member of type Integer; when loaded from the dataBase (very
first time) records with no values are displayed as empty fields in the
gridView, after I update one of  these records (leaving the field blank) the
value becomes ZERO.

I tried converting the member type to Nullable(Of Integer) but "Nothing" is
then not accepted anymore (as opposed to being transformed n 0).

Does someone have any idea on resolving this issue?

Thanks,

R.

Author
27 Mar 2006 5:26 AM
Cor Ligthert [MVP]
Rachel,

As that are the business rules in the Busines Object that you have got, than
we cannot change anything in that.

It looks for me that it get initial null/nothing and that it returns a empty
string if it is a null value.

Just my thought,

Cor

AddThis Social Bookmark Button