I have a column set as a checkbox, yet I can't change the value by clicking the checkbox.. I can change the CellValue in code, and it sticks, but it won't update the checkbox in the field, nor can I click the checkbox itself (well, I can, it just doesn't toggle the value).
If this is not the problem, is this a GriddataBoundGrid or a GridControl you are using?
TLTom LangerJune 10, 2003 04:51 PM UTC
Thanks, this will do the trick. I'm using the plain ol grid.
TLTom LangerJune 10, 2003 05:02 PM UTC
I spoke too soon...
I tried out the code and a get an error:
An unhandled exception of type 'System.FormatException' occurred in system.dll
Additional information: 0 is not a valid value for Boolean.
Here's the code I'm using:
grdLineItems(tmpRow, 1).CellType = "CheckBox"
grdLineItems(tmpRow, 1).CheckBoxOptions = New GridCheckBoxCellInfo("1", "0", "", True)
grdLineItems(tmpRow, 1).Text = "0"
looks the same as yours.. So I'm guessing some other problem? Any properties in the grid that prevent it from working? It's not readonly, I also know this because I can type free text in other cells.
TLTom LangerJune 10, 2003 05:07 PM UTC
Problem resolved.. The above code DOES work, I just had the value type of the column set to boolean, I set it to string and it's fine now.