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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16722 |

    Right now when the user selects a cell or row the cell or row is highlighted and the border around the selected cell is changed to the dotted line.  I would like to change that to a more solid dark border. How do I control the selected cell border?  Is it part of a stylesheet?

     

    Imported from legacy forums. Posted by Brian (had 712 views)

    User (Old forums)
    Member
    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.

    e.g.:

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.