Question make column of datagrid keypress event?

Mrt

Member
Joined
May 18, 2010
Messages
16
Programming Experience
1-3
Hello,

I need some help using a datagrid control

My question is how can I create an event that would catch an enter key when I am editing it. Like I would type a note and hit enter key when I finish. Because columns of the datagrid does not have events like other controls or datagrid itself.
What I need is something like this:
Code:
Private Sub ColumnNote_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ColumnNote.KeyPress
End Sub
but it would return me an error saying control columnNote does note have such event

and what I got at the moment is this
Code:
Private Sub DataGridNotes_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DataGridNotes.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
Save_Note()
Fill_Notes()
End If
End Sub
as I said before this has a problem, it will not catch the enter key while I am in edit mode (typing in it) which I need to resolve

VB.net 2008
 

Latest posts

Back
Top