Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enter key in data grid
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00772127
Message ID:
00772145
Views:
18
This message has been marked as the solution to the initial question of the thread.
Hi Mufi,

To move horizontally in a DataGrid you need to use the TAB key instead of ENTER. You can add this functionality to your DataGrid by creating a subclass of the DataGrid and build the ENTER key in. Here is an example:
Public Class ctlDatagridEnter
   Inherits DataGrid

   Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, _
      ByVal keyData As System.Windows.Forms.Keys) As Boolean

      If msg.WParam.ToInt32() = CInt(Keys.Enter) Then
         SendKeys.Send("{Tab}")
         Return True
      End If

      Return MyBase.ProcessCmdKey(msg, keyData)

   End Function
End Class
>hi,
>every body,
>
>i using data grid in vb.net but when i press enter key on keyboard cursor does't move to next cell horizontaliy.
>
>thanks
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform