Click here to Skip to main content
12,405,303 members (63,899 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
I have one datagridview. If I edit Columns in grid and press enter key then I want to generate code on that keypress.
Posted 26-Mar-12 22:29pm
dcba1894
Comments
Shahin Khorshidnia 27-Mar-12 5:16am
   
Please tag your question.
WinForm? ASP.Net? WPF? Silver Light? other...?
Rate this: bad
 
good
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 
  Permalink  
v2
Comments
smp 234 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.
smp 234 30-Mar-12 2:10am
   
thanks!!!!!!1
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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