Skip to main content

PivotGridControl.CustomDrawFieldHeader Event

Enables field headers to be painted manually.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v23.2.dll

NuGet Package: DevExpress.Win.PivotGrid


public event PivotCustomDrawFieldHeaderEventHandler CustomDrawFieldHeader

Event Data

The CustomDrawFieldHeader event's data class is PivotCustomDrawFieldHeaderEventArgs. The following properties provide information specific to this event:

Property Description
Appearance Gets the painted element’s appearance settings. Inherited from PivotCustomDrawEventArgs.
Bounds Gets the bounding rectangle of the painted element. Inherited from PivotCustomDrawEventArgs.
Field Gets the field whose header is to be painted.
Graphics Gets an object used to paint an element. Inherited from PivotCustomDrawEventArgs.
GraphicsCache Gets an object which specifies the storage for the most used pens, fonts and brushes. Inherited from PivotCustomDrawEventArgs.
Handled Gets or sets whether an event was handled, if it was handled the default actions are not required. Inherited from PivotCustomDrawEventArgs.
Info Gets an object which provides the information required to paint a field header.
Painter Gets the painter object that provides the default element painting mechanism.
ThreadSafeArgs Gets an event parameter that provides thread-safe access to event data.

The event data class exposes the following methods:

Method Description
DefaultDraw() Performs default painting of an element. Inherited from PivotCustomDrawEventArgs.


The CustomDrawFieldHeader event is raised before a field header is painted. Its event parameter provides all the information required to paint a cell. The field whose header is currently being processed is identified by the event parameter’s PivotCustomDrawFieldHeaderEventArgs.Field property. The PivotCustomDrawCellEventArgs.Handled property must be set to true to prohibit the default cell painting.

Important Note: custom drawing of any kind is ignored when printing PivotGridControl.

To access event data while an asynchronous operation is being performed, use a thread-safe event parameter returned by the PivotCustomDrawFieldHeaderEventArgs.ThreadSafeArgs property. To learn more, see Asynchronous Mode.


Do not change cell values, modify the control’s layout, or change the control’s object model in the events used for custom control painting. Actions that update the layout can cause the control to malfunction.

See Also