Aplicativos do Windows
Recolher sumário
Expandir sumário
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

RowDefinition.Height property

Gets the calculated height of a RowDefinition element, or sets the GridLength value of a row that is defined by the RowDefinition.


public GridLength Height { get; set; }

<RowDefinition Height="doubleValue"/>
- or -
<RowDefinition Height="starSizing"/>
<RowDefinition Height="Auto"/>

XAML Values


The row's height, 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 row's height, described by the literal Auto. For more information about Auto sizing, see Grid.

Property value

Type: GridLength

The GridLength that represents the height of the row. The default value is a GridLength representing a "1*" sizing.


The default value of Width is a GridLength representing a "1*" sizing. This structure value has a Value data value of 1.0, and a GridUnitType data value of Star. With this default, each new RowDefinition you define for a Grid will have "1*" sizing, and each will be allotted an equal number of pixels for height of its content in layout handling. It's not uncommon to define RowDefinition as an object element in XAML without any attributes set and to just use this default behavior. The same is true for ColumnDefinition.

The value you set for Height can be constrained if you also set a value for MinHeight or MaxHeight. Each of these properties can take only pixel measurements, not Star sizing. If a RowDefinition uses Star or Auto sizing but also has MinHeight or MaxHeight constraints, the MinHeight or MaxHeight must be honored by the Grid layout behavior, even if that means giving or taking layout space from other Star sizing rows defined in the Grid that don't have constraints.

It's more common to use Star sizing than absolute pixel values for a Grid definition in a Windows Store app using C++, C#, or Visual Basic. Star sizing supports the dynamic layout concept, which helps your app look great on screens with different sizes, pixel densities and orientations. For more info, see Define layouts with XAML.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::UI::Xaml::Controls [C++]



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]


Windows::UI::Xaml::Controls [C++]



See also

Define layouts with XAML



© 2016 Microsoft