Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridControl.CreateGraphicsCache() Method

Creates a GraphicsCache object for the current GridControl.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.2.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