Back to Devexpress

GridControl.CreateGraphicsCache() Method

windowsforms-devexpress-dot-xtragrid-dot-gridcontrol-995b658b.md

latest1.8 KB
Original Source

GridControl.CreateGraphicsCache() Method

Creates a GraphicsCache object for the current GridControl.

Namespace : DevExpress.XtraGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public GraphicsCache CreateGraphicsCache()
vb
Public Function CreateGraphicsCache As GraphicsCache

Returns

TypeDescription
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

GridControl Class

GridControl Members

DevExpress.XtraGrid Namespace