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

PivotGridControl.CustomDrawEmptyArea Event

Enables a Pivot Grid Control’s background to be custom painted.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v19.1.dll


public event PivotCustomDrawEventHandler CustomDrawEmptyArea

Event Data

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

Property Description
Appearance Gets the painted element’s appearance settings.
Bounds Gets the bounding rectangle of the painted element.
Graphics Gets an object used to paint an element.
GraphicsCache Gets an object which specifies the storage for the most used pens, fonts and brushes.
Handled Gets or sets whether an event was handled, if it was handled the default actions are not required.
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.


Handle the CustomDrawEmptyArea event to custom paint the Pivot Grid Control’s empty area. This is the area which isn’t occupied by any rows. Set the event parameter’s PivotCustomDrawEventArgs.Handled property to true to disable default background painting. The other properties of the event parameter provide you with all the necessary information to paint the background.

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 PivotCustomDrawEventArgs.ThreadSafeArgs property. To learn more, see Asynchronous Mode.


Never change cell values or modify the control’s layout on this event, or any other event designed to tune the control’s appearance. Any action that causes a layout update can cause the control to malfunction.

See Also