MinWidth Property

DataGridColumn.MinWidth Property

Gets or sets the minimum column width in pixels.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

public double MinWidth { get; set; }
<sdk:dataGridColumn MinWidth="double"/>

XAML Values

sdk:dataGridColumn

Typically, sdk:DataGridTextColumn, sdk:DataGridCheckBoxColumn, or sdk:DataGridTemplateColumn.

Property Value

Type: System.Double
The minimum column width in pixels, or 0 if the value is not set. The default is 0.

ExceptionCondition
ArgumentOutOfRangeException

When setting this property, the specified value is less than 0.

-or-

The specified value is greater than the DataGridColumn.MaxWidth.

-or-

The specified value is greater than the DataGrid.MaxColumnWidth and the DataGridColumn.MaxWidth is not set.

ArgumentException

The specified value is NaN.

-or-

The specified value is PositiveInfinity.

This property overrides the DataGrid.MinColumnWidth property.

If the DataGridColumn.MaxWidth property is set, MinWidth must be less than or equal to the MaxWidth property value. If the DataGridColumn.MaxWidth property is not set, MinWidth must be less than or equal to the DataGrid.MaxColumnWidth property value.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2016 Microsoft