I have a dbgrid control, with one column containing a button (this is the button from the dbgrid properties of the column). The column is a text field that contains either "Yes" or "No". When the user clicks the button, it will toggle it to the opposite of what is in the cell. In my grid, however, it only works on the first cell that I click it on. I get the little editing pencil in the left margin, but then it doesn't go away and I can't change any other values. Any idea what's going on?
Here's my code...
Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
If DBGrid1.Columns(ColIndex) = "Yes" Then
DBGrid1.Columns(ColIndex) = "No"
ElseIf DBGrid1.Columns(ColIndex) = "No" Then
DBGrid1.Columns(ColIndex) = "Yes"
End If
End Sub
Here's my code...
Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
If DBGrid1.Columns(ColIndex) = "Yes" Then
DBGrid1.Columns(ColIndex) = "No"
ElseIf DBGrid1.Columns(ColIndex) = "No" Then
DBGrid1.Columns(ColIndex) = "Yes"
End If
End Sub