DataGrid Null Items

When I have an object datatsource bound to the grid and the user
deletes a text box column entry or
changes a check box to false
in the grid,
the grid errors with can not convert system.dbnull to string and
the update errors with must have a value for the check box.
It appears that the grid is setting empty strings to null and unchecked check boxes to null.
How can I prevent this?
I really would like to do the buisness rule checking and error handling in the buisness object.
That is not a bunch of exception handling and guessing in the grids error event.
[614 byte] By [chuck02323] at [2007-12-16]
# 1
There isn't any way to prevent this in the DataGrid. You best bet is to use the new DataGridView in Visual Studio 2005.

-mark
Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
Oops, I was using the DataGridView (vs05 beta 2), just forgot to type the whole name.
chuck02323 at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3

Cool. Change the NullValue to String.Empty. You can do this via the DefaultCellStyle:

DataGridView1.Columns(1).DefaultCellStyle.NullValue = String.Empty

-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
For the boolean object and checkbox field
I tried setting the CellStyle Null Value to false and 0.
I tried setting the true and false values.
I tried putting default values into the ObjectDataSource's constructor.
No change.
chuck02323 at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...