HotXLS Docs

AfterCell 事件

在当前行中由 ColumnIndex 指定的列保存到单元格之后发生

说明

您可以使用此事件对明细区域中的任何导出单元格应用条件格式

语法

TDBGridAfterCell = procedure (Sender: TObject; Cell: IXLSRange; RowIndex, ColumnIndex: Integer; Column: TColumn) of object;
Sender TObject。指定触发该事件的 TGridToXLS 组件
Cell IXLSRange。表示所导出的单元格
RowIndex Integer。当前行的索引
ColumnIndex Integer。列的索引
Column TColumn。一个表示该列的对象

示例

此示例将奇数列的内部颜色设置为银色

procedure TForm1.GridToXLS1AfterCell(Sender: TObject;
  Cell: IXLSRange; RowIndex, ColumnIndex: Integer; Column: TColumn);
begin
  if Odd(ColumnIndex + 1) then Cell.Interior.Color := ColorToRGB(clSilver);
end;