Export (0) Print
Expand All

DataGrid.BorderStyle Property

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

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft