What does RowDefinition Height="10*" mean in a XAML Grid?

Edward Tanguay picture Edward Tanguay · Jul 22, 2009 · Viewed 61k times · Source

I use Height="*" a bit to mean that the height of the last row should fill to the bottom of the grid.

But what does "10*" mean?

<Grid Name="mainGrid">
    <Grid.RowDefinitions>
        <RowDefinition Height="100" />
        <RowDefinition Height="40" />
        <RowDefinition Height="10*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="200"  />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
</Grid>

Answer

Kent Boogaart picture Kent Boogaart · Jul 22, 2009

"*" is shorthand for "1*". It's a ratio, so if you have two rows, one with "*" and one with "10*", the former gets 1/11th of the available and the latter gets 10/11th of the space.

In your example above, "10*" is unnecessary - "*" would make more sense because there is only one row using ratio-based sizing, so any ratio will equate to 100% of the available space.