One way you can move to the next column when the user presses Enter is to subclass your DataGrid and override its ProcessKeyPreview method checking for the Enter key and swapping it for the Tab key.
Const WM_KEYDOWN As Integer = &H100
Protected Overrides Function ProcessKeyPreview(ByRef m As System.Windows.Forms.Message) As Boolean
Dim keyCode As Keys = CType(m.WParam.ToInt32(), Keys) And Keys.KeyCode
If m.Msg = WM_KEYDOWN And keyCode = Keys.Enter Then
m.WParam = New IntPtr(Keys.Tab)
End If
Return MyBase.ProcessKeyPreview(m)
End Function 'ProcessKeyPreview
>Hi to all!!
>
>I have to admit that it has been very tough for me to migrate my skills from VB6 to Vb.Net, the concepts are about 100% different, and as there are some easier ways to do things there also are harder ways to other.
>
>well,
>
>The issue is:
>
>I've noticed that when I press the enter key on a grid bounded to a datatable it navigates to the next row and it doesn't raises no event to the datagrid, not even a TextBox declared withevents for controling a datagrid column.
>
>The question is:
>
>How can I validate the enter key on a Datagrid to have it navigate to the right and when it's in the last column then navigate down/back just like a carrier return.
>
>I'll appreciate your help, thanks in advance.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi