StartEditor on Popup Form

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
ghanshaw
Newbie
Newbie
Posts: 13
Joined: Wed Dec 13, 2017 12:00 am

StartEditor on Popup Form

Post by ghanshaw » Thu Mar 15, 2018 10:59 am

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.

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: StartEditor on Popup Form

Post by Yeray » Mon Mar 19, 2018 10:13 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply