DataGridColumnStyle.Width 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 width of the column.

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

public virtual int Width { get; set; }

Property Value

Type: System.Int32

The width of the column, in pixels.

The following code example sets the width of a DataGridColumnStyle to a new value.

Private Sub SetWidth()
   Dim dgc As DataGridColumnStyle
   dgc = DataGrid1.TableStyles(0).GridColumnStyles("id")
   dgc.Width = 500
End Sub

.NET Framework
Available since 1.1
Return to top