I have an UltraGrid control on my form that handles KeyDown events on certain cells without a problem. I am using the keydown event to enable 'Excel-like' navigation between cells/rows using the arrow keys. However, certain cells don't appear to fire the KeyDown event when the arrow keys are pressed. When they are pressed the focus moves to a different control on the form. Other keys seem to work fine, i.e. the event is fired.
The cells where this occurs have checkboxes or masked text (formatted date/time) and all are set to 'NoEdit'. I'm reasonably certain this is the root of the problem, but I've read that the UltraGrid's keydown event should still fire for these cells.
Any suggestions on what might be consuming the KeyDown message before the UltraGrid receives it?
Hi,
Same problem here:
Tried on Infragistics 11.2.20112.2019 Service pack.
Not able to use "F1" key press.
Am I using a wrong event? Not sure.
My sample code is below"
Private Sub UltraGrid1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles UltraGrid1.KeyDown Dim myFileName As String = Nothing If e.KeyCode = Keys.Enter Then MsgBox("Enter Key clicked") ' This is working ElseIf e.KeyCode = Keys.F10 Then MsgBox("F1 clicked") End If End Sub
I tried this out using v8.1, v9.1, and v10.3 and it works just fine for me in all versions.
I also tried it in a normal text cell, a DateTime cell with masking, and a checkbox cell in all three versions and it works fine for me in all cases. The KeyDown event fires for both the left and right arrow key.
So either this is a bug in the specific version of the control you are using - in which case, maybe you just need to get the latest service release.
How to get the latest service release - Infragistics Community
Or, something else in your application is handling those keys before they get to the grid.
Hi Mike,
The following keys don't fire the events:TabEscapeEnterPrtScnF1, F3, F5, F6Arrow keys ('standard' and num pad w/num lock off) (on certain cells)
As you said, keys like the Tab key are processed by the form (the same is probably true for Escape, Enter, PrtScn and the Function keys).
The arrow keys do fire the KeyDown event except when the cells contains something other than 'plain' text.
The grid is version 9.1.
Thanks.
Which keys don't fire the events? There are certain keys, like the Tab key, that are handled by the form and no control will get a KeyDown event for them.
It's also possible that your form has a toolbar or menu that is handling some keys before they get to the grid for processing.
Also... what version of the grid are you using?