Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to handle keypress event in datagridview cell
Message
De
03/01/2009 00:36:46
 
 
À
02/01/2009 23:38:35
Arjun Bagojikop
Dynamic Super Software
Sangli, Inde
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01370794
Message ID:
01370798
Vues:
15
I think that you probably need a sub-class of the DataGridViewTextBoxEditingControl (or your own control that implements the IDataGridViewEditingControl) and then override the EditingControlWantsInputKey method. That should work.

I tried to do a similar thing that you've tried below, and could not get it to work either, so I'm thinking that my above suggestion may be your only option.

~~Bonnie



>hi all
>i am trying to handle keypress event but i am not getting result like after press enter key
> Private Sub dataGridView_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
> AddHandler e.Control.KeyDown, AddressOf Control_KeyPress
> End Sub
>
> Private Sub Control_KeyPress(ByVal sender As Object, ByVal e As KeyEventArgs)
> MsgBox(e.KeyCode)
>
>
> 'If e.KeyChar = Chr(13) Then
> ' 'If (Char.IsNumber(e.KeyChar)) Then
> ' MsgBox("OK")
>
> ' ' //your code here
> 'End If
>
> End Sub
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform