TTMSFNCDataGrid w/Buttons

I seem to have found an issue with FNCDataGrid on a VCL form, with buttons in the cells.

When the form uses any type of styles
eg. TStyleManager.TrySetStyle('Windows10 Dark');

This error comes when clicking on a button in the FNCDataGrid.

This error does not comes if default windows/delphi style are used.

Are there any known workaround?

Hi,

Are you using the latest version?

Yes,

My latest version are: tms.fnc.uipack:6.3.1.0

We tried it here but aren't able to reproduce the issue. Can you put together a sample? Perhaps there are some settings that we miss in order for us to reproduce the issue.

I have uploaded the test project i made.

I have also copied a screenshot of the changes i made in the project options. The one without using any type of style works fine. The other where i choose a style, it fals when clicking any button in the grid


Test.zip (191.4 KB)

With the test app we are able to reproduce the issue and are currently investigating.

Ok so what happens is that the active button parent is set to nil, and then reparented after updating the grid, when this happens from an OnClick event, this unfortunately gives issues, it's unclear why styles have a different effect. the issue is also reproducible when dropping a single button on a new form, with styles enabled and the following code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Button1.Parent := nil;
end;

To workaround this issue, please set a timer in DGCellButtonClick with an interval of 1 to let the windows messages be handled first, and then execute CatchClick to update the grid.