Back to Devexpress

TcxCustomPivotGrid.OnCustomDrawFieldHeader Event

vcl-cxcustompivotgrid-dot-tcxcustompivotgrid-cd396033.md

latest1.4 KB
Original Source

TcxCustomPivotGrid.OnCustomDrawFieldHeader Event

Enables you to custom paint a field header.

Declaration

delphi
property OnCustomDrawFieldHeader: TcxPivotGridCustomDrawFieldHeaderEvent read; write;

Remarks

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.

delphi
procedure <Form>.<PivotGrid>CustomDrawFieldHeader(Sender: TcxCustomPivotGrid; ACanvas: TcxCanvas; AViewInfo: TcxPivotGridFieldHeaderCellViewInfo; var ADone: Boolean);
begin
  AViewInfo.AlignHorz := taCenter;
end;
cpp
void __fastcall <Form>::<PivotGrid> CustomDrawFieldHeader(TcxCustomPivotGrid *Sender, TcxCanvas *ACanvas, TcxPivotGridFieldHeaderCellViewInfo *AViewInfo, bool &ADone)
{
  AViewInfo->AlignHorz = taCenter;
}

See Also

TcxCustomPivotGrid Class

TcxCustomPivotGrid Members

cxCustomPivotGrid Unit