Grid.Row attached property

Gets or sets the row alignment of an element when child layout is processed by a visual tree parent Grid.

<object Grid.Row="int"/>

XAML Values


The zero-based index of the Grid row that the element should appear within. See Remarks.


Grid.Row is an attached property, which supports a XAML usage. When setting this property in code, use SetRow instead. When getting this property in code, use GetRow 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 RowProperty as the dependency property identifier.

A Grid.Row value is interpreted by the most immediate parent Grid element from where the value is set. The value is used along with Grid.Column to specify the layout characteristics of each child element of a Grid. Grid.RowSpan also influences the layout.

The row and column counts are zero-based. Negative integer values for Grid.Row are not permitted. 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

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]





See also

Attached properties overview
Define layouts with XAML