Are you adding checkboxes to datagrid at runtime?
Dim chk As New DataGridViewCheckBoxCell
If condition Then
chk.Value = True
Else
chk.Value = False
End If
' Add checkbox control to datagrid
DataGridView1.Item(0, 0) = chk
If not, then
If condition Then
DataGridView1.Item(0, 0).Value = True
Else
DataGridView1.Item(0, 0).Value = False
End If
"object reference not set"-error comes from declaring an object dim chk as checkbox but not creating the instance, like dim chk as New checkbox
Teme64
Veteran Poster
1,031 posts since Aug 2008
Reputation Points: 218
Solved Threads: 203