Click here to Skip to main content
14,638,468 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have one datagridview. If I edit Columns in grid and press enter key then I want to generate code on that keypress.
Posted
Comments
Shahin Khorshidnia 27-Mar-12 5:16am
   
Please tag your question.
WinForm? ASP.Net? WPF? Silver Light? other...?
Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi,
DataGridView: Make Enter Key Move to Next Column[^]
================================================
Change form's Keypreview property to true
and write the following code-

If e.KeyCode = Keys.Enter Then
          'Code to execute
      End If 
   
v2
Comments
dcba1 28-Mar-12 2:39am
   
if I press enter key then I want to edit the data in datagridview. I want to execute code on that event.
Jαved 29-Mar-12 5:16am
   
I have updated the answer.
dcba1 30-Mar-12 2:10am
   
thanks!!!!!!1
Rate this:
Please Sign up or sign in to vote.

Solution 2

If Asc(e.KeyChar) = 13 Then
          'Code to execute
      End If
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100