What does the value of RowDefinition Height = "10 *" in the XAML grid mean?

I use Height = "*" a bit to indicate that the height of the last row should be filled 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> 
+58
wpf xaml grid
Jul 22 '09 at 9:50
source share
3 answers

"*" is the abbreviation for "1*" . This is a ratio, so if you have two lines, one with "*" and one with "10*" , the first gets the 11th of the available, and the last gets the 10/11th place.

In the above example, "10*" not required - "*" will make more sense because there is only one line using a relation-based relation, so any ratio will equal 100% of the available space.

+91
Jul 22 '09 at 9:53
source share

I found the information below from Christian Mosers to be useful, since Auto and fixed sizes in other row or column cells will influence * size behavior. See http://wpftutorial.net/GridLayout.html




Fixed Fixed size logical units (1/96 inch)

Auto Takes up as much space as needed with the built-in control

Star (*) Takes up as much space as is available (after filling in all columns of automatic and fixed size), proportionally divided by all columns of star size. So 3 * / 5 * means the same as 30 * / 50 *. Remember that star size does not work if the mesh size is calculated based on its contents.

 <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="28" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="200" /> </Grid.ColumnDefinitions> </Grid> 
+18
Aug 15 2018-12-15T00:
source share

In xaml * used for percent (%), so 10* means 10% of the total grid. The row will use 10% of the grid.

-eleven
12 '15 at 6:28
source share



All Articles