I got a weird problem with the rowSpan property of a grid.
I got a text that will take more than one line, so I told his stack spanel, RowSpan="2"
, so the text can be on multiple line, using Wrapping to, like this :
<StackPanel Grid.Row="0"
Grid.RowSpan="2"
Orientation="Horizontal">
<TextBlock x:Name="tbConfirm"
Text={Binding TextConfirm}
HorizontalAlignment="Center"
TextWrapping="Wrap"
VerticalAlignment="Center"
Grid.RowSpan="2"
FontSize="12">
</TextBlock>
</StackPanel>
The property TextConfirm contains a text that should take two lines (I tried with the text without binding to see if it fills.
But, despite my RowSpan and my TextWrapping, it still on one line, and don't understand why.
When I make a column span, it will take the number of column define, but why row span doesn't work?
There is in the Grid, 5 column(width auto) and 5 row(height auto) define.
If I want to have one textblock, one textbox, and another one textblock.
How can I tell to go in the new line automatically? Undefined width for the two textblocks, and define width for the textbox.
This is just an example, I don't wrote it at the moment.
<StackPanel Grid.Row="0"
Grid.RowSpan="2"
Orientation="Horizontal">
<TextBlock x:Name="tbConfirm"
Text={Binding TextConfirm}
HorizontalAlignment="Center"
TextWrapping="Wrap"
VerticalAlignment="Center"
Grid.RowSpan="2"
FontSize="12">
</TextBlock>
<textBox width ="200"/>
<TextBlock x:Name="tbConfirm2"
Text={Binding TextConfirm2}
HorizontalAlignment="Center"
TextWrapping="Wrap"
VerticalAlignment="Center"
Grid.RowSpan="2"
FontSize="12">
</TextBlock>
</StackPanel>
Will this, go automatically at the new line if necessary? Or do I need to define lines and colums in the xaml?
Thank you.