1

With Dephi XE, when the user clicks a button, I want to be able to select a cell (no problem) in a StringGrid (SG) and then allow the user to immediately start typing into that cell.

SG.Row := DesiredRow;
SG.Col := 1;
SG.SetFocus;

This sets the desired cell to blue, but the user has to click on a cell to type into it. I want the user to be able to start typing immediately after clicking the button, without using his mouse.

TLama
  • 75,147
  • 17
  • 214
  • 392
bobonwhidbey
  • 485
  • 7
  • 17

1 Answers1

10

Set EditorMode of the stringgrid to true: SG.EditorMode := True; 'goEditing' should be set in the Options property for this to work.

Alternatively you can set goAlwaysShowEditor besides goEditing in grid Options.

Sertac Akyuz
  • 54,131
  • 4
  • 102
  • 169