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 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:
Here I have visited three rows and they show the checkboxes.
And for comparison the XE6 test;
DefaultDrawing
on or off? – Tom Brunberg