DataGridViewHeaderBorderStyle DataGridViewHeaderBorderStyle DataGridViewHeaderBorderStyle DataGridViewHeaderBorderStyle Enum

Definition

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

public enum class DataGridViewHeaderBorderStyle
public enum DataGridViewHeaderBorderStyle
type DataGridViewHeaderBorderStyle = 
Public Enum DataGridViewHeaderBorderStyle
Inheritance
DataGridViewHeaderBorderStyleDataGridViewHeaderBorderStyleDataGridViewHeaderBorderStyleDataGridViewHeaderBorderStyle

Fields

Custom Custom Custom Custom 0

A border that has been customized.

None None None None 4

No borders.

Raised Raised Raised Raised 2

A three-dimensional raised border.

Single Single Single Single 1

A single-line border.

Sunken Sunken Sunken Sunken 3

A three-dimensional sunken border.

Examples

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;
}
Private Sub SetBorderAndGridlineStyles()

    With Me.dataGridView1
        .GridColor = Color.BlueViolet
        .BorderStyle = BorderStyle.Fixed3D
        .CellBorderStyle = DataGridViewCellBorderStyle.None
        .RowHeadersBorderStyle = _
            DataGridViewHeaderBorderStyle.Single
        .ColumnHeadersBorderStyle = _
            DataGridViewHeaderBorderStyle.Single
    End With

End Sub

Applies to

See also