The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Grid.ColumnSpan attached property

Gets or sets a value that indicates the total number of columns that the element content spans within a parent Grid.

<object Grid.ColumnSpan="int"/>

XAML Values


The number of Grid columns that the element should span, as a value between 1 and the maximum column count. See Remarks.


Grid.ColumnSpan is an attached property, which supports a XAML usage. When setting this property in code, use SetColumnSpan instead. When getting this property in code, use GetColumnSpan instead. In code usages, the target parameter is the object where the attached property value is set. Another way to get or set the value in code is to use the dependency property system, calling either GetValue or SetValue and passing ColumnSpanProperty as the dependency property identifier.

A Grid.ColumnSpan value is interpreted by the most immediate parent Grid element from where the value is set.

Zero or negative integer values for Grid.ColumnSpan are not permitted. Values that are greater than the total number of columns are treated as if they specified the total number and will span all columns. You establish the layout characteristics of a Grid by setting the RowDefinitions and ColumnDefinitions properties. These are collections that contain one or more RowDefinition / ColumnDefinition objects, which are typically specified as elements in XAML.

Requirements (Windows 10 device family)

Device family

API contract




Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012





See also

Attached properties overview
Define layouts with XAML