Sorry for the imprecise Subject on this post as I did not know quite how to describe the issue in a few words. The problem is that after editing a cell containing a custom inplace editor based on a TEdit connected to a TFormControlEditLink, an extra mouse click is required to activate other controls. This problem can be demonstrated by dropping a TAdvstringgrid, a tedit, a tbitbtn amd a TFormControlEditLink on a Form. Enable editing in the grid and set up OnGetEditortype as shown below. After editing a cell, click on the close button and nothing happens. Click the close button a second time and the button works as expected.
Is there some option that I haven't set or something else that I have done wrong?
Thank you!
unit Unit5;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons, AdvGrid,
frmctrllink, Vcl.ExtCtrls, Vcl.Grids, AdvObj, BaseGrid;
type
TForm5 = class(TForm)
AdvStringGrid1: TAdvStringGrid;
FormControlEditLink1: TFormControlEditLink;
BitBtn1: TBitBtn;
Edit1: TEdit;
procedure BitBtn1Click(Sender: TObject);
procedure AdvStringGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer;
var AEditor: TEditorType);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
procedure TForm5.AdvStringGrid1GetEditorType(Sender: TObject;
ACol, ARow: Integer; var AEditor: TEditorType);
begin
AEditor := edCustom;
FormControlEditLink1.Control := Edit1;
AdvStringGrid1.EditLink := FormControlEditLink1;
end;
procedure TForm5.BitBtn1Click(Sender: TObject);
begin
close;
end;
end.