ColumnDefinitions Property
Collapse the table of content
Expand the table of content

Grid.ColumnDefinitions Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets a ColumnDefinitionCollection defined on this instance of Grid.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public ColumnDefinitionCollection ColumnDefinitions { get; }

XAML Values


One or more ColumnDefinition elements. Each such ColumnDefinition becomes a placeholder representing a column in the final grid layout.

The ColumnDefinitionCollection contains the ColumnDefinition objects that define each column of the grid available for positioning elements.

If a child element is added to a column within 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.

When setting this property in XAML, do not include an explicit ColumnDefinitionCollection object element. Instead use implicit collection syntax. For more information, see the Remarks section in ColumnDefinitionCollection.


By default, a grid contains one row and one column.

The following example creates a Grid with two columns using ColumnDefinitions.

    <ColumnDefinition Width="350" />
    <ColumnDefinition Width="130" />

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft