Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 2.52 KB

File metadata and controls

43 lines (29 loc) · 2.52 KB

WinForms Data Grid - Draw a thick border under a data cell (PaintEx event)

This example shows how to draw a thick border around a grid cell under the mouse pointer:

WinForms Data Grid - Draw thick cell borders by handling the PaintX event

The example handles the grid's PaintEx event to draw a border. The PaintEx event allows you to use DirectX-compatible APIs (e.Cache):

private void GridControl_PaintEx(object sender, DevExpress.XtraGrid.PaintExEventArgs e) {
    DrawHotTrackedCell(e.Cache);
}

private void DrawHotTrackedCell(GraphicsCache cache) {
    Rectangle bounds = GetCellBounds(HotTrackedCell);
    cache.DrawRectangle(new Pen(Brushes.Black, _BorderWidth), bounds);
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)