Grid doesn't layout according to the ColumnDefinition
Posted: 06 Aug 2021, 08:52
Hi,
In the code below, blue column width does not become the specified value. And, Text is cut off.
This is a different behavior than WPF.
By the way, if you delete the TextBlock with the above code, it will be displayed as intended.
Do you know how to work around this issue?
In the code below, blue column width does not become the specified value. And, Text is cut off.
This is a different behavior than WPF.
Code: Select all
<Grid Grid.Row="1" Width="100" Height="100">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="70"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="Gray"/>
<Border Grid.Column="1" Background="Blue"/>
<TextBlock Grid.ColumnSpan="2" Background="Green" Height="50"
TextWrapping="Wrap"
FontSize="14"
Text="123456789123456789"/>
</Grid>
</Grid>
Do you know how to work around this issue?