FNCDatagrid exception when clearing grid

With the latest version of the FNCDataGrid an exeption occurs when clearing the grid (with previous versions it was working wel)

I added a test project, if you click the button 2x the exception will happen.

Somehow the Grid.ClearCells(cellrange) has issues.

I hope to find a solution.

gridtest.zip (48.5 KB)

Hi,

Please wrap the code with BeginUpdate/EndUpdate to bundle all changes

procedure TForm1.TMSFNCButton1Click(Sender: TObject);
var
  row: integer;
begin
  TMSFNCDataGrid1.BeginUpdate;
  ClearGrid(TMSFNCDataGrid1);
  for row := 1 to 10 do
  begin
    GridButton(TMSFNCDataGrid1, TMSFNCBitmapContainer1.Bitmaps[0], 0, row, nil);
  end;
  TMSFNCDataGrid1.EndUpdate;
end;

We’ll investigate what the exact cause for the issue is when not using the wrappers.

Thanks I will try that.

Unfortunately the exception still occurs.

I’m just looking for a similar function as ClearNormalCells()

Are you using the latest version?

Yes I’m using the latest version of FNCDataGrid

In previous versions of the DataGrid I had no issues But with the latest version this error occurs.

Somehow The

grid.ClearCells(cellrange) function

triggers the TControl.GetWidth function in FMX.Controls with an unavailable FSize object, which is causing the exception.

Is there any other way I can clear the grid without losing the column headers and the column widths etc.?

Hi,

We have further investigated this here and applied a patch. Next version of TMS FNC UI Pack will have this included.