.NET Framework Class Library for Silverlight
Grid..::.RowDefinitions Property

Gets a RowDefinitionCollection defined on this instance of Grid.

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

Visual Basic (Declaration)
Public ReadOnly Property RowDefinitions As RowDefinitionCollection
    Get
Visual Basic (Usage)
Dim instance As Grid
Dim value As RowDefinitionCollection

value = instance.RowDefinitions
C#
public RowDefinitionCollection RowDefinitions { get; }
XAML Property Element Usage
<grid>
  <grid.RowDefinitions>
    oneOrMoreRowDefinitions
  </grid.RowDefinitions>
</grid>

XAML Values

oneOrMoreRowDefinitions

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

Property Value

Type: System.Windows.Controls..::.RowDefinitionCollection
A RowDefinitionCollection defined on this instance of Grid.
Remarks

The RowDefinitionCollection contains the RowDefinition objects that define each row of the grid available for positioning elements.

If a child element is added to a row within a Grid and the row has its Height property set to Auto, the child will be measured without restrictions. This behavior can prevent vertical 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 RowDefinitionCollection object element. Instead, use implicit collection syntax. For more information, see the Remarks section in RowDefinitionCollection.

NoteNote:

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

Examples

The following example creates a Grid with three rows. The Height of the first row is set to the value Auto, which distributes height evenly based on the size of the content that is within that row. The height of the second column and third column are set to 2* and * respectively. The second column gets 2/3 of the remaining space and the third column gets 1/3.

XAML
<Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="2*" />
    <RowDefinition Height="*"/>
</Grid.RowDefinitions>
Platforms

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

See Also

Reference

Other Resources

Tags :


Page view tracker