Ala*_*ace 9 delphi tgrid firemonkey
我有一个混合列的TGrid(ImageColumn和StringColumn).我可以使用onGetValue事件填充它,它可以正常工作.我的问题是:
如何强制整个网格重建并导致onGetValue事件?我正在使用UpdateStyle.
如何更新网格中的单个单元格?
网格仅更新可见单元格!Grid1.UpdateStyle强制网格重建并导致onGetValue事件但速度很慢.Grid1.ReAlign要快得多.
一旦细胞变得可见,它们就会被更新.
更新1个单元格:
procedure TForm1.UpdateCell(col, row: integer);
var
cell: TStyledControl;
begin
cell := Grid1.Columns[col].CellControlByRow(row);
if Assigned(cell) then
cell.Data := 'Note: use the same datasource as OnGetValue';
end;
Run Code Online (Sandbox Code Playgroud)
当行永远不可见时,不会分配单元格.