AD
Administrator
Syncfusion Team
June 4, 2003 02:21 PM UTC
There is a Me.GridDataBoundGrid1.Model.Options.EnterKeyBehavior property that controls how the enter key behaves within the grid, but moving to the OK button is not an option.
In the 1.6 code base, there is a property that you can set,
Me.GridDataBoundGrid1.WantEnterKey = False
to tell the grid not to process the enter key. If you set this, then the form will handle the key.
If you want to handle this in 1.5.2.0, you could catch the CurrentCellKeyDown event, and if it is the enter key, call the form's acceptbutton.
Private Sub GridDataBoundGrid1_CurrentCellKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles GridDataBoundGrid1.CurrentCellKeyDown
If e.KeyCode = Keys.Enter Then
Me.AcceptButton.PerformClick()
e.Handled = True
End If
End Sub