Hello,
I have a problem which I can't seem to solve. I have a bound a data table to a datagridview, this datatable has a column called "Status" which is of type boolean. I can set the value to true or false just fine for via code. However, I can't figure out how to check and see if the a give row is already checked or not. This is the code I am trying to use and it keeps saying the "The Specified Cast Is Invalid." Any help would be appreciated.
if (rowIndex >= 0)
{
DataGridViewCheckBoxCell CbxCell = (DataGridViewCheckBoxCell)dgv_Scan.Rows[rowIndex].Cells["Status"];
if ((bool)CbxCell.Value == true)
{
//Do stuff
}
else
{
//Do Stuff
}
}
Thanks, Nathan