Width Property
Collapse the table of content
Expand the table of content

ColumnDefinition.Width Property

Gets the calculated width of a ColumnDefinition element, or sets the GridLength value of a column that is defined by the ColumnDefinition.

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

public GridLength Width { get; set; }
<ColumnDefinition Width="doubleValue"/>
- or -
<ColumnDefinition Width="starSizing"/>
<ColumnDefinition Width="Auto"/>

XAML Values


The column's width, expressed as a floating-point value for a pixel count. Typically this is specified as an integer, although interpolation of floating-point values is supported by grid layout.


A convention by which you can size rows or columns to take the remaining available space in a Grid. A star sizing always includes the asterisk character (*), and optionally precedes the asterisk with an integer value that specifies a weighted factor versus other possible star sizings (for example, 3*). For more information about star sizing, see Grid.


The column's width, described by the literal Auto. For more information about Auto sizing, see Grid or GridLength.

Property Value

Type: System.Windows.GridLength
The GridLength that represents the width of the column. The default value is 1.0.

Dependency property identifier field: WidthProperty

If a child element is added to a column in a Grid, and the column has its Width property set to Auto, the child will be measured without restrictions. This behavior can prevent horizontal scroll bars from displaying if a ScrollViewer is being used, as the child element is measured as unbounded. For purposes of display, the child is clipped instead of scrolled.

The default GridUnitType is Star.


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

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

Community Additions

© 2015 Microsoft