现在我想获得我放入数据网格的新值;但是,如果我向上或向下键,我总是会得到旧值。
这是我的 KeyDownEvent 函数:
Private Sub grd_MyGridKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles grd.MyGridKeyDown
If e.KeyCode = Keys.Left Or e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Right Or e.KeyCode = Keys.Up Or e.KeyCode = Keys.Down Then
Me.grd.Item(Me.grd.CurrentRowIndex, 4) = Me.grd.Item(Me.grd.CurrentRowIndex, 2) * Me.grd.Item(Me.grd.CurrentRowIndex, 3)
End If
End Sub