DataGridViewHeaderBorderStyle Enumeration

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Specifies the border style that can be applied to the ColumnHeadersBorderStyle and RowHeadersBorderStyle properties of a DataGridView control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public enum DataGridViewHeaderBorderStyle

Member nameDescription
Custom

A border that has been customized.

None

No borders.

Raised

A three-dimensional raised border.

Single

A single-line border.

Sunken

A three-dimensional sunken border.

The following code example illustrates the use of this type. For more information, see How to: Change the Border and Gridline Styles in the Windows Forms DataGridView Control.

private void SetBorderAndGridlineStyles()
{
    this.dataGridView1.GridColor = Color.BlueViolet;
    this.dataGridView1.BorderStyle = BorderStyle.Fixed3D;
    this.dataGridView1.CellBorderStyle =
        DataGridViewCellBorderStyle.None;
    this.dataGridView1.RowHeadersBorderStyle =
        DataGridViewHeaderBorderStyle.Single;
    this.dataGridView1.ColumnHeadersBorderStyle =
        DataGridViewHeaderBorderStyle.Single;
}

.NET Framework
Available since 2.0
Return to top
Show: