NativeExcel suite v1.x

AfterDetailCell event

Occurs after the specified by ColumnIndex column of the current row is saved into the Excel cell.

Description

You can use this event to apply conditional formatting to any exported cell in the detail area.

Syntax

TDBGridAfterDetailCell = procedure (Sender: TObject; Cell: IXLSRange; RowIndex, ColumnIndex: integer; Column: TColumn) of object;
SenderTObject. Specifies the TDBGrid2Excel component that triggered the event.
CellIXLSRange. Represents the cell which is exported.
RowIndexInteger. The index of the current row.
ColumnIndexInteger. The index of the column.
ColumnTColumn. An object that represents the column.

Example

This example sets the interior color for odd columns to silver.
procedure TForm1.DBGrid2Excel1AfterDetailCell(Sender: TObject;
  Cell: IXLSRange; RowIndex, ColumnIndex: Integer; Column: TColumn);
begin
  if Odd(ColumnIndex + 1) then Cell.Interior.Color := ColorToRGB(clSilver);
end;
Copyright © NikaSoft 2004-2012