DataGridColumn.MaxWidth Property

Gets or sets the maximum column width in pixels.

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

'Declaration
Public Property MaxWidth As Double
<sdk:dataGridColumn MaxWidth="double"/>

XAML Values

sdk:dataGridColumn

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

Property Value

Type: System.Double
The maximum column width in pixels. The default is PositiveInfinity.

ExceptionCondition
ArgumentOutOfRangeException

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

-or-

The specified value is less than the DataGridColumn.MinWidth.

-or-

The specified value is less than the DataGrid.MinColumnWidth and the DataGridColumn.MinWidth is not set.

This property overrides the DataGrid.MaxColumnWidth property.

If the DataGridColumn.MinWidth property is set, MaxWidth must be greater than or equal to the MinWidth property value. If the DataGridColumn.MinWidth property is not set, MaxWidth must be greater than or equal to the DataGrid.MinColumnWidth 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: