Skip to main content
All docs
V24.2

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

DXWIN0001: DirectX-incompatible Graphics

In This Article

Severity: Error

It is generally recommended to avoid paint methods from the Graphics class since these methods are not functional if the DirectX Hardware Acceleration is on. Instead, use methods of the DevExpress.Utils.Drawing.GraphicsCache class.

#Invalid Code

C#
private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
   e.Graphics.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
} 

#Valid Code

C#
private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
   e.Cache.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
}