views:

210

answers:

1

Am using TJvUltimGrid, when pressing either the up or down arrow, to move from one record to the next, the event fires every other press. Does anyone have any ideas why it does not fire on every press and what I can do to fix it?

The dataset is a TADODataSet. The onKeyDown fires on every press.

REF: Delphi 2010 with Jedi JVCL Version 3.39, Windows XP

A: 

As Smasher said, the OnKeyPress event only is only fired for keys with a ASCII char. To respond to the arrow keys you need to use OnKeyDown or OnKeyUp .

Here is a quote from the online help.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event.

Reference: OnKeyPress

stukelly
Thank you for your response. The key events onKeyPress and onKeyDown are working correctly. It is the onKeyUp that is not working as described in the documentation. It is the OnKeyUp that is skipping ever other row in the TJvUltimGrid.
Doug