Hi,
I want to be able to navigate through my rows using only up and down keys (without CTRL key pressed). For instance, if I press KeyDown the selected row in UltraGrid is “selected again”. And it’s necessary to press KeyDown again to select the next row.
If I press CTRL + KeyDown, it’s work perfectly. But I don’t want use CTRL key.
Like another Infragistics user has posted in the forum, I tried the following code on UltraGrid KeyDown event:
If e.KeyCode = Keys.Down Then
UltraGrid1.PerformAction(UltraGridAction.BelowCell)
e.SuppressKeyPress = True
ElseIf e.KeyCode = Keys.Up Then
UltraGrid1.PerformAction(UltraGridAction.AboveCell)
End If
But this event isn’t fired on first time that I press KeyDown (or KeyUp). If I change “Keys.Down” and “Keys.Up” for “Keys.NumPad2” and “Keys.NumPad8”, for example, it will work.
If the event is not firing, then my guess is that the keystroke is being handled by something else. But without knowing the exact state that the grid is in, it's hard to say what that might be.
Can you reproduce this behavior in a small sample project and post it here so I can check it out?
Hi, Mike.
When I was creating the small sample project, I found the solution to my problem. I was setting the focus to another control. So, when I was clicking Keys.Down, for example, first it was setting the focus to my ultragrid and after that it was changing the selected row correctly.
I was setting the focus to another control because the selected row receives a “focus border” and doing that, the border would disappear.
Thanks.
If you want to get rid of the focus rect: HOWTO:How can I turn off the Focus Rectangle on an Infragistics Win Control?
This is probably what you need:
HOWTO:UltraWinGrid Cursor Movement like Excel
Hello,
I don't understand your answers. I don't know where to put this part of VB code.My goal is to press key down, up, left or right and move the cursor on grid.
Can yoyu help me ?
Laurent