DataGridView.RowHeadersBorderStyle Property
Gets or sets the border style of the row header cells.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
'Declaration <BrowsableAttribute(True)> _ Public Property RowHeadersBorderStyle As DataGridViewHeaderBorderStyle 'Usage Dim instance As DataGridView Dim value As DataGridViewHeaderBorderStyle value = instance.RowHeadersBorderStyle instance.RowHeadersBorderStyle = value
Property Value
Type: System.Windows.Forms.DataGridViewHeaderBorderStyleOne of the DataGridViewHeaderBorderStyle values.
| Exception | Condition |
|---|---|
| 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.
Note: |
|---|
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 Sub SetBorderAndGridlineStyles() With Me.dataGridView1 .GridColor = Color.BlueViolet .BorderStyle = BorderStyle.Fixed3D .CellBorderStyle = DataGridViewCellBorderStyle.None .RowHeadersBorderStyle = _ DataGridViewHeaderBorderStyle.Single .ColumnHeadersBorderStyle = _ DataGridViewHeaderBorderStyle.Single End With End Sub
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: