Occurs after the column title specified by ColumnIndex is saved into the
cell
Beschrijving
You can use this event to apply conditional fofmatting to header cell
Syntaxis
TDBGridAfterTitle =
procedure(Sender: TObject; Cell:
IXLSRange; ColumnIndex: Integer; Column: TColumn) of object;
| Sender |
TObject. Specificeert the TGridToXLS component that triggered the event |
| Cell |
IXLSRange which represents the cell with the column title |
| ColumnIndex |
Integer. The index of the column |
| Column |
TColumn. An object that represents the column |
Voorbeeld
This example set the width of the column with index 3
procedure TForm1.GridToXLS1AfterTitle(Sender: TObject;
Cell: IXLSRange; ColumnIndex: Integer; Column: TColumn);
begin
if ColumnIndex = 3 then Cell.ColumnWidth := 30;
end;
This example show how to change the text of column title
procedure TForm1.GridToXLS1AfterTitle(Sender: TObject;
Cell: IXLSRange; ColumnIndex: Integer; Column: TColumn);
begin
Cell.Value := StringReplace(Cell.Value, '_', ' ', [rfReplaceAll]);
end;