DataGrid.BorderStyle Property


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

Gets or sets the grid's border style.

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

public BorderStyle BorderStyle { get; set; }

Property Value

Type: System.Windows.Forms.BorderStyle

One of the BorderStyle enumeration values. The default is FixedSingle.

The following code example sets the style of the grid's border.

Private Sub SetBorderStyle(ByRef myGrid As DataGrid, ByRef style As Integer)
    Select Case style
    Case 0
       myGrid.BorderStyle = System.Windows.Forms.BorderStyle.None
    Case 1
       myGrid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
    Case 2 
       myGrid.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Case Else
       myGrid.BorderStyle = System.Windows.Forms.BorderStyle.None
    End Select
 End Sub

.NET Framework
Available since 1.1
Return to top