I have bound a data table to a DataGridView, this data table has a column called \"Status\" which is of type Boolean. I can set the value to
DataGridView
Boolean
CbxCell.Value must be equal to DBNull.Value (your column can contain null values right?)
CbxCell.Value
DBNull.Value
I would check for DBNull before casting:
if (!DBNull.Value.Equals(CbxCell.Value) && (bool)CbxCell.Value == true) { //Do stuff } else { //Do Stuff }