This example shows how to draw a thick border around a grid cell under the mouse pointer:
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);
}- Form1.cs (VB: Form1.vb)
- Program.cs (VB: Program.vb)
(you will be redirected to DevExpress.com to submit your response)
