DataGrid - KeyPress event

  • Thread starter Thread starter john sutor
  • Start date Start date
J

john sutor

When moving up and down with the arrow keys on my DataGrid, I cannot get
either the Keypress, KeyUp or KeyDown events to respond. I am putting
breakpoints in to capture the event but they never get fired. Any input
will be helpful.

JOhn
 
john said:
When moving up and down with the arrow keys on my DataGrid, I cannot
get either the Keypress, KeyUp or KeyDown events to respond. I am
putting breakpoints in to capture the event but they never get fired.
Any input will be helpful.

Does the selected index changed event fire?


Christina Androne
 
john sutor said:
When moving up and down with the arrow keys on my DataGrid, I cannot get
either the Keypress, KeyUp or KeyDown events to respond. I am putting
breakpoints in to capture the event but they never get fired. Any input
will be helpful.

Don't know about key events, but is the CellChanged event firing?

Tobin
 
Alright.....try this...
You should create a method than handle de keydown event. something like
this

Private Sub Move_Grid (ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles DataGrid.KeyDown

End Sub

There you should check if the key pressed is the one you want to react,
like this:

If e.KeyCode = Keys.PageDown then or something like this
[Code for scrolling down]
End if

well I hope this helps....

David Sabo
Caracas, Venezuela
 
Ok this may sound a bit unorthodox but if you try it you will be amazed at
how good the results can be. First obtain a graphic of Michael Jordon that
shows him about to make a difficult shot. Note the position of his tongue as
he attempts the shot. Now here is the most important part.....as closely as
possible mimic this critical tongue position you retry the Keypress, KeyUp
or KeyDown events.

I love this game!
 
Back
Top