Skip to main content

Cell border

Comments

1 comment

  • Dapfor Team

    Hi,
    You have two possibilities to do it :

    1. By setting Grid.Appearance properties:


    grid.Appearance.VerticalLines = true;
    grid.Appearance.VerticalLinesColor = Color.Blue;
    grid.Appearance.HorizontalLines = true;
    grid.Appearance.HorizontalLinesColor = Color.Blue;



    2. By implementing Grid.PaintCell event :


    grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
    {
    //Do default drawing
    e.PaintAll();
    e.Handled = true;

    //Do custom drawing
    using(Pen pn = new Pen(Color.Blue))
    {
    Rectangle rect2 = new Rectangle(e.Cell.VisibleBounds.X, e.Cell.VisibleBounds.Location.Y, e.Cell.VisibleBounds.Width, e.Cell.VisibleBounds.Height);
    e.Graphics.DrawRectangle(pn, rect2);
    pn.Dispose();
    }
    };


    Best regards,
    The Dapfor Team

    0

Please sign in to leave a comment.

Powered by Zendesk