我们正在将我们的应用程序从 XE6 迁移到柏林 10.1,并且我们的自定义网格样式不起作用。当我测试时,我回到 XE6 来查看使用 TCheckcolumn 时的默认 gridstyle 和 checkcellstyle,它工作正常。然后我去了 10.1 Berlin 并在使用 TCheckcolumn 时测试了默认的 gridstyle 和 checkcellstyle 并且它不起作用。即,除非您单击网格中的行,否则复选框不会显示......并且在它显示之后,您无法选中或取消选中它。这是一个错误还是我们在 10.1 Berlin 中需要做的其他事情?
问问题
1564 次
1 回答
3
XE6 FMX.Grid 和 Delphi 10.1 Berlin FMX.Grid,特别是 TCheckColumn 之间的区别在于,在 XE6 中,复选框是可见的,即使链接TValue
是Empty
. 直到 D10 西雅图,情况都是如此。在 D10.1 Berlin 中,这已被更改,复选框仅在链接TValue
为False
或时可见True
。如果TValue
是Empty
复选框未显示。
在 D10.1 Berlin 中,以下测试(类似于文档示例)适用于我:
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;
在运行时它看起来像这样:
在这里,我访问了三行,它们显示了复选框。
并进行比较 XE6 测试;
于 2016-08-08T19:31:34.970 回答