Reference checkbox value in datagridview

agroom

Active member
Joined
Sep 14, 2006
Messages
39
Programming Experience
Beginner
How do I reference the value of a checkbox in a datagridview?

In the datagridview edit column window, I set the "FalseValue" and "TrueValue" to "False" and "True" respectively.

Then I try to access them using this:

If Me.TDataGridView.Item(Column, Row).Value = "False" Then
~~~
End If

But here's the error message I get:

Operator '=' is not defined for type 'DBNull' and string "True ".

I don't understand. If I set the underlying value of FalseValue to "False" shouldn't the value of an unchecked checkbox = "False" then? Or am I referencing the wrong cell attribute?
 
I'd also like to note if I display the value of the cell, I'll get a string of "True" or "False"

For example

Msgbox(Me.TDataGridView.Item(Column, Row).Value) will display the word True or False in respect to if it's checked or not.
 
Back
Top