This is probably an easy 1 minute question but...
I have a DataSet that has an integer which is one of 3 values (0, 1, NULL).
I bind this data set to the grid and set the column as a checkbox. Most of the values are NULL and I want NULL to default to unchecked state but it defaults to checked state.
I went and set the Nullable Text to 0 and the Default Value to decimal 0.
It still comes out as checked. What am I doing wrong?
Hi,
Are you sure the value is Null? A DataTable/DataSet usually uses DBNull instead of Null.
In any case, I tested this out using both null and DBNull and it works correctly for me. The null/DBNull fields display the CheckBox in the Indeterminate state, not as checked. This happens regardless of whether I use CheckBox or TriStateCheckbox as the column's Style.