1
votes

We are moving our application from XE6 to 10.1 Berlin and we have a custom grid style not working. As I test, I went back to XE6 to look at the default gridstyle & checkcellstyle when using a TCheckcolumn and it works fine. I then went to 10.1 Berlin and tested the default gridstyle and checkcellstyle when using a TCheckcolumn and it does NOT work. i.e., the checkbox does not show unless you click on the row in grid....and after it does show, you can't check or uncheck it. Is this a bug or is there something else we need to do in 10.1 Berlin?

1
What are the exact minimal steps to reproduce? What is the custom grid style? Is the grids DefaultDrawing on or off?Tom Brunberg
drop a grid on the form. Right click to add items. Add a TCheckColumn, and add a TStringColumn. You should see the check boxes right away, but you dont. You have to click a row first...but even then, you can't check the box. I even tried at runtime and with data in the row. These steps all work fine in both XE6 and XE7.John
sorry, the custom gridstyle is "gridstyle" by default. If you choose default style on the grid you will find itJohn

1 Answers

3
votes

The difference between XE6 FMX.Grid and Delphi 10.1 Berlin FMX.Grid, specifically the TCheckColumn, is that in XE6 the checkboxes are visible even if the linked TValue is Empty. This was the case up until D10 Seattle. In D10.1 Berlin this was changed so, that the checkboxes are visible only if the linked TValue is either False or True. If TValue is Empty the checkbox is not shown.

In D10.1 Berlin the following test (similar to the document example) works for me:

type
  TForm27 = class(TForm)
    Grid1: TGrid;
    Column1: TColumn;
    CheckColumn1: TCheckColumn;
    StringColumn1: TStringColumn;
    procedure Grid1GetValue(Sender: TObject; const ACol, ARow: Integer;
      var Value: TValue);
    procedure Grid1SetValue(Sender: TObject; const ACol, ARow: Integer;
      const Value: TValue);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    Arr: array of TValue;
  public
    { Public declarations }
  end;

implementation

procedure TForm27.FormCreate(Sender: TObject);
begin
  SetLength(Arr, Grid1.RowCount);
end;

procedure TForm27.Grid1GetValue(Sender: TObject; const ACol, ARow: Integer;
  var Value: TValue);
begin
  if ACol = 1 then
    Value := Arr[ARow];
end;

procedure TForm27.Grid1SetValue(Sender: TObject; const ACol, ARow: Integer;
  const Value: TValue);
begin
  if ACol = 1 then
   Arr[ARow] := Value.AsBoolean;
end;

And at runtime it looks like this:

enter image description here

Here I have visited three rows and they show the checkboxes.

And for comparison the XE6 test;

enter image description here