The CheckboxOptions of the GridStyleInfo object has a string datatype for the IndetermValue property. The problem is my bound column (Db Constraint) accepts "Y", "N" and null as valid values. How do I get the grid to push DbNull.Value when the user clicks to the third Indeterminate option?
When I use DbNull.Value.ToString() it''s just an empty string (""), so thats what the bound column gets, instead of the desired value of DbNull.
ADAdministrator Syncfusion Team July 26, 2005 02:45 AM UTC
Thank-you that works. Is there like an internal reason why the data types of the CheckBoxOptions have to be strings? Perhaps if they were instead of type object, than supplying DbNull.Value or anything else would be an option, instead of attaching to the prescribed event?
ADAdministrator Syncfusion Team July 26, 2005 07:24 AM UTC
The checkbox options determined what is displayed in the cell. For example, if CellValueType is bool, then a bool value is stored in the cell, and you set the display values in the check box options to be "true", "false" and "" as that is what will be displayed as text in the cell. Here, a DBNull.Value is stored as the indeterminate value since when the grid converts a "" to a bool it comes up with DBNull.
But in your case, you actually are storing strings ("Y", "N") as the cell values so this means the CellValueType must be string. When the grid then tries to convert the indeterminate value "" to string, well it already is a string, so the grid leaves it alone. The grid does not know you want it to change the empty string into a DBNull since the cellvaluetype is string and the empty string is a valid string. So, in your use case, swapping the empty string for DBNull takes the additional work of handling an event. If your cellvaluetype was bool, this would not be needed.