Home Forums WinForms controls Xceed Grid for WinForms Change cell border of selected cell or row. Reply To: Change cell border of selected cell or row.

User (Old forums)
Post count: 23064

The only way to set this is to derive from the GridControl and override the PaintFocusRectangle() method, and then use this custom grid in your code.


private class CustomGrid : GridControl
      protected override void PaintFocusRectangle( VisualGridElement gridElement, Graphics graphics, Rectangle displayRectangle, Color backColor, Color foreColor, bool printing )
        Rectangle focusRectangle = new Rectangle( displayRectangle.X, displayRectangle.Y, displayRectangle.Width – 1, displayRectangle.Height – 1);

        graphics.DrawRectangle( Pens.Red, focusRectangle );

Imported from legacy forums. Posted by André (had 980 views)