Problem with last version of TAdvStringGrid

Hello
I have a problem when I try to open a Form from a click in a cell of a TAdvStringGrid. The behavior is present when the goRangeSelect option is true. The problem itself is that the grid goes into selection mode even if I didn't click on a cell when closing the Form.

Here's how to reproduce the problem:

In a form, add the TAdvStringGrid.

Set the goRangeSelect option to true if it is not.

Add to the onClick property of the grid the opening of a Form.

Then, after starting the project, click in a cell to open the form.

Close form.

Click on the same cell a second time to open the Form and then close it.

Normally the grid should be in selection mode if you hover the cursor over it without clicking. Sometimes it happens that you have to redo the manipulation of opening and closing the Form by clicking on the same cell 2 to 3 times.

Here the code of the test project:

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvUtil, Vcl.Grids, AdvObj, BaseGrid,
  AdvGrid;

type
  TForm1 = class(TForm)
    AdvStringGrid1: TAdvStringGrid;
    procedure AdvStringGrid1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.AdvStringGrid1Click(Sender: TObject);
begin
var
  popup: TForm;
begin
  popup := TForm.Create(nil);
  popup.ShowModal;

end;

end;
end.

System information:
Windows 11 Entreprise
Embarcadero® Delphi 11 Version 28.0.48361.3236
TMS VLC UI PACK
WORK in version 12.2.1.1
NOT WORKING in version 13.1.10.4
exemple

Try to move the opening of the form from the OnMouseUp event handler, as you are interrupting a typical mouse-down, (click) mouse-up sequence here.

It works for this case though, I also have to deal with a double click. It's a medical application, click on specific cell edit a note for this row, while a double click is used to manage the information of the row. So the double click gives me the same problem as the click.

I would like to emphasize that has been functional for years and now with the update the problem is present.

We are not aware of changes that would cause this but we will investigate

I did some tests. Version 12.2.1.1 works fine. 13.0.3.0 does not work. The behavior has therefore changed between its two versions.

Maybe in this change.
12.2.2.0

  • Fixed : Issue with OnClick triggered during Find() in TAdvStringGrid

We will investigate

1 Like

We have applied a fix that will be included in the next update

Thank you, it's greatly appreciated