View Single Post
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 115
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Checkbox in Datagridview

 
0
  #2
Dec 17th, 2008
Are you adding checkboxes to datagrid at runtime?
  1. Dim chk As New DataGridViewCheckBoxCell
  2.  
  3. If condition Then
  4. chk.Value = True
  5. Else
  6. chk.Value = False
  7. End If
  8. ' Add checkbox control to datagrid
  9. DataGridView1.Item(0, 0) = chk
If not, then
  1. If condition Then
  2. DataGridView1.Item(0, 0).Value = True
  3. Else
  4. DataGridView1.Item(0, 0).Value = False
  5. 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
Reply With Quote