Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 23:29pm
dcba1895
Comments
Shahin Khorshidnia at 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 at 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 at 29-Mar-12 5:16am
   
I have updated the answer.
smp 234 at 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
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2014
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