Skip to main content
A newer version of this page is available. .

PivotGridControl.CustomDrawFieldHeader Event

Enables field headers to be painted manually.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v18.1.dll

Declaration

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.

Remarks

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.

Note

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.

Note

The control’s events designed to change the appearance or rendering of control elements must not be used to update cell values or to modify the control’s layout. Any inappropriate operation which causes a layout update, may break the normal control behavior.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomDrawFieldHeader event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also