vcl-cxcustompivotgrid-dot-tcxcustompivotgrid-cd396033.md
Enables you to custom paint a field header.
property OnCustomDrawFieldHeader: TcxPivotGridCustomDrawFieldHeaderEvent read; write;
The Sender parameter specifies the pivot grid whose field header is about to be painted.
The ACanvas parameter specifies the drawing surface.
The AViewInfo parameter provides information (a ViewInfo object) for rendering the field header.
Pass True as the ADone parameter to prevent default painting.
The following code example shows how to handle the OnCustomDrawFieldHeader event to horizontally center field header captions.
procedure <Form>.<PivotGrid>CustomDrawFieldHeader(Sender: TcxCustomPivotGrid; ACanvas: TcxCanvas; AViewInfo: TcxPivotGridFieldHeaderCellViewInfo; var ADone: Boolean);
begin
AViewInfo.AlignHorz := taCenter;
end;
void __fastcall <Form>::<PivotGrid> CustomDrawFieldHeader(TcxCustomPivotGrid *Sender, TcxCanvas *ACanvas, TcxPivotGridFieldHeaderCellViewInfo *AViewInfo, bool &ADone)
{
AViewInfo->AlignHorz = taCenter;
}
See Also