Docs HotXLS

AfterCell événement

Se produit après que la colonne spécifiée par ColumnIndex de la ligne courante est enregistrée dans la cellule

Description

Vous pouvez utiliser cet événement pour appliquer une mise en forme conditionnelle à n'importe quelle cellule exportée de la zone de détail

Syntaxe

TDBGridAfterCell = procedure (Sender: TObject; Cell: IXLSRange; RowIndex, ColumnIndex: Integer; Column: TColumn) of object;
Sender TObject. Specifies the TGridToXLS component that triggered the event
Cell IXLSRange. Represents the cell which is exported
RowIndex Integer. The index of the current row
ColumnIndex Integer. The index of the column
Column TColumn. An object that represents the column

Exemple

This example sets the interior color for odd columns to silver

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