Cellborder datagridview

ankit goel 746 Reputation points

Hi ,

in my datagridview , i have turned off the cell border by using
this.CellBorderStyle = DataGridViewCellBorderStyle.None;

User's image

but still when its cell gets focused by using mouse , i can there there is a dashed line type border in the cell . To prevent this , i tried using

this.SelectionMode = DataGridViewSelectionMode.FullRowSelect , but no success . How to prevent this please suggest

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,865 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,523 questions
{count} votes

Accepted answer
  1. gekka 7,826 Reputation points MVP
    this.dataGridView1.CellPainting += (s, e) =>
        if (e.ColumnIndex == 1)
            e.Paint(e.ClipBounds, e.PaintParts & ~DataGridViewPaintParts.Focus);
            e.Handled = true;

0 additional answers

Sort by: Most helpful