I have a DataGridView that is populated by a DataSet. I'm attempting to return the value of a CheckBox in the DataGridView so I can color the row orange:
The code above throws:
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
I have attempted replacing the CheckedState.Checked with True, 1 etc. Any thoughts?
VB.NET:
For Each band As DataGridViewBand In DataGridView1.Rows
If DataGridView1.Rows(band.Index).Cells("HOLD").Value = CheckState.Checked Then
band.DefaultCellStyle.BackColor = Color.DarkOrange
End If
Next
The code above throws:
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
I have attempted replacing the CheckedState.Checked with True, 1 etc. Any thoughts?