Home All Groups Group Topic Archive Search About

DataGridViewCheckBoxColumn null/default value

Author
10 Feb 2007 6:28 AM
juhimg
Hi,

I'm using a DataGridView with some checkboxes
(DataGridViewCheckBoxColumn). It seems that the check box is
initialized to null. I set the TrueValue, FalseValue, and
IndeterminateValue to the appropriate values (true/false). But I
haven't found any property that sets the null value to false. As a
result, I always get NULL if no action was done on the checkbox.
I need to do the following-
1. How can I make the NULL value of the DataGridViewCheckBoxColumn to
indicate false.
2. How can I set the default value of the checkbox - i.e. when the
grid is loaded with the checkbox, it should be checked.

Any pointers in this direction would really be appreciated!

Thanks,
Juhi.

Author
11 Feb 2007 9:23 AM
ClayB
Is this DataGridView bound to a particular DataSource? If so, you
might try making sure the DataSource does not contain null values (or
DBNulls) in that column. For bound grids, the default behavior is to
just reflect what comes from the bound datasource.

===============
Clay Burch
Syncfusion, Inc.
Author
12 Feb 2007 4:52 AM
juhimg
On Feb 11, 1:23 am, "ClayB" <c***@syncfusion.com> wrote:
> Is this DataGridView bound to a particular DataSource? If so, you
> might try making sure the DataSource does not contain null values (or
> DBNulls) in that column. For bound grids, the default behavior is to
> just reflect what comes from the bound datasource.
>
> ===============
> Clay Burch
> Syncfusion, Inc.

The DataGridView is bound to a datasource. But I'm having a problem
with new rows that are added to the grid. For every new row, the
checkbox is initialized to NULL and I don't know how to make NULL be
set to FALSE.
Any thoughts on this??
Thanks much in advance!
--Juhi

AddThis Social Bookmark Button