Hi,
Windows 7x64
Delphi 10.1 Update 2
TMS Component Pack 8.8.8.1
We have a problem with the AdvStringGrid with an EditLink. We cannot reproduce this problem with version 8.8.4.1, but we can in 8.8.7.0.
(We do not have versions between 8.8.4.1 and 8.8.7.0)
====
Create a project with a form containing an AdvStringGrid with 2 columns and 3 rows.
Use AsgLinks
Create a field variable FEditLink: TEditLink
On the form Create add this code:
procedure TForm1.FormCreate(Sender: TObject);
begin
FEditLink := TAdvEditEditLink.Create(nil);
advstrngrd1.GridCells[1,1] := 'AAA';
advstrngrd1.GridCells[1,2] := 'BBB';
end;
Add an OnGetEditorType event to the grid with this code:
procedure TForm5.AdvStringGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType);
begin
if (ACol = 1) and (ARow > 0) then
begin
AEditor := edCustom;
AdvStringGrid1.EditLink := FEditLink;
end;
end;
Add an CanEditCell event with this code:
procedure TForm5.AdvStringGrid1CanEditCell(Sender: TObject; ARow, ACol: Integer; var CanEdit: Boolean);
begin
CanEdit := (ACol = 1) and (ARow > 0);
end;
Now, click twice on the cell containing 'AAA'. You should now be able to edit it.
Now click once on the cell containing 'BBB'.
Actual result: Cell 'BBB' is in edition mode with the text of Cell 'AAA' in it.
Expected result: Cell 'BBB' is selected but not in edition mode. (Like v8.8.4.1 or when AEditor is set to edNormal)
Is this a new desired behavior? If so, how can we circumvent it?
Thank you for your time.