Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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...?

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

VB
If e.KeyCode = Keys.Enter Then
          'Code to execute
      End If 
 
Share this answer
 
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
VB
If Asc(e.KeyChar) = 13 Then
          'Code to execute
      End If
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900