Topic: Just Using keyboard- tab and select row inside tablegrid?

Only using keyboard
It seems like tab order does stop for TableGrid but how I can select row inside, arrow keys[only works once I click with mouse inside tablegrid].

Any other ways let me know.
Thanks

Re: Just Using keyboard- tab and select row inside tablegrid?

If you simply want to use the tab key to enter the tablegrid, then you can add the following code to the object that has a 'tab order' number immediately prior to the 'tab order' number of the tablegrid:

procedure Form1_ComboBox1_OnExit (Sender: TObject);
begin
  form1.tablegrid1.SelectedRow := 0;
  form1.tablegrid1.setfocus;
end;

More generally, if you want to use keyboard shortcuts instead of the mouse for various actions, have a look at the attachment to get an idea for the sorts of things you can do (ALT + A = add a record, ALT + T = tablegrid etc etc). 
Click on the '?' on Form to see what keyboard shortcuts are available.
ALT + G (Go To Row) is slightly different; if 'Go To Row' on Form1 is empty, then ALT + G will take you to that field to enter a row number in the tablegrid but once 'Go To Row' is not empty, then ALT + G will take you into the tablegrid and place the cursor on the specified row number.
Don't forget that 'key preview' must be enabled for keyboard shortcuts to work (see screenshot in the attachment).
Derek.

Post's attachments

Attachment icon using keyboard.zip 520.47 kb, 115 downloads since 2024-07-18