Page 1 of 1

StartEditor on Popup Form

Posted: Thu Mar 15, 2018 10:59 am
by 18682546
I have a detail screen that pops up when I am editing the main form. I am trying to get it to start the editor on the first cell in the grid of the new popup form. If I try to start the editor I get an error "Cannot focus on a disabled or invisible window". I checked and the grid is enabled but not focused so I tried the SetFocus command but get the same error when I am trying to SetFocus. How can I get the screen to come up with the Editor started. AutoEdit doesn't seem to do the trick either.

Re: StartEditor on Popup Form

Posted: Mon Mar 19, 2018 10:13 am
by yeray
Hello,

I'm getting this same error when I try to set the first cell in edit mode at FormCreate. But it works fine if I do the same at FormShow.

Code: Select all

type TVCLTeeGridAccess=class(TVCLTeeGrid);

procedure TStringGridForm.FormShow(Sender: TObject);
begin
  TVCLTeeGridAccess(TeeGrid1.Grid).StartEditor(TeeGrid1.Columns[0], 0);
end;