Skip to main content

GridControl.CreateGraphicsCache() Method

Creates a GraphicsCache object for the current GridControl.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

public GraphicsCache CreateGraphicsCache()

Returns

Type Description
GraphicsCache

A GraphicsCache object. null if no control handle is currently created.

Remarks

When handling grid control events, you may want to access the control’s Graphics surface (for example, to calculate custom text size). Certain events (e.g., GridView.MeasurePreviewHeight) provide no event parameters to access the Graphics surface. In these cases, use the CreateGraphicsCache method to obtain the GridControl’s graphics surface.

The object returned by the CreateGraphicsCache method must be manually disposed of when it is no longer needed.

See Also