ptaylor965 6 Junior Poster

I need to update a cell with the Value from another cell
when a checkbox in the grid is checked but i need it to
update on clicking the checkbox


The only way i have is to do it on CellEndEdit but this requires the user to change cell first

My Code:

Private Sub dgData_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgData.CellEndEdit
' MsgBox(dgData.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
If dgData.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = "True" Then
dgData.Rows(e.RowIndex).Cells("DespQty").Value = dgData.Rows(e.RowIndex).Cells("Stock").Value
Else
dgData.Rows(e.RowIndex).Cells("DespQty").Value = 0
End If
End Sub