Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataGridView.RowHeadersBorderStyle Property

Gets or sets the border style of the row header cells.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public DataGridViewHeaderBorderStyle RowHeadersBorderStyle { get; set; }
/** @property */
public DataGridViewHeaderBorderStyle get_RowHeadersBorderStyle ()

/** @property */
public void set_RowHeadersBorderStyle (DataGridViewHeaderBorderStyle value)

public function get RowHeadersBorderStyle () : DataGridViewHeaderBorderStyle

public function set RowHeadersBorderStyle (value : DataGridViewHeaderBorderStyle)

Not applicable.

Property Value

One of the DataGridViewHeaderBorderStyle values.

Exception typeCondition

InvalidEnumArgumentException

The specified value when setting this property is not a valid DataGridViewHeaderBorderStyle value.

ArgumentException

The specified value when setting this property is Custom.

If the RowHeadersBorderStyle property is set to anything other than Single, the GridColor property must be a system color.

You cannot set this property to the Custom value, which is a read-only value indicating that the border style has been customized through the use of the AdvancedRowHeadersBorderStyle property.

NoteNote:

If visual styles are enabled for the application through the Application.EnableVisualStyles method and the EnableHeadersVisualStyles property is true, the row headers are painted using the current theme. In this case, the value of the RowHeadersBorderStyle property is ignored for all row headers except the TopLeftHeaderCell, to which the theme is not applied.

The following code example illustrates the use of this property.

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;
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

Show:
© 2014 Microsoft