Home > DeveloperSection > Forums > How can I manage columnspan in a grid using wpf?
Babe Zaharias
Babe Zaharias

Total Post:19

Points:133
Posted on    October-14-2013 7:40 AM

 WPF WPF 
Ratings:


 1 Reply(s)
 1128  View(s)
Rate this:
<Grid Margin="20" VerticalAlignment="Top" HorizontalAlignment="Stretch">
 <Grid.RowDefinitions>
    <RowDefinition />
    <RowDefinition />
 </Grid.RowDefinitions>
 
 <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
 </Grid.ColumnDefinitions>
 <TextBlock  Grid.Row="0" Grid.Column="0" Margin="0,0,10,0" x:Name="TxtBox_cCodeTiers" Text="{Binding m_strCode}" FontWeight="Bold" FontSize="22" />
 <TextBlock  Grid.Row="0" Grid.Column="1" Margin="0,0,10,0" x:Name="TxtBox_cNomTiers" Text="{Binding m_strNom}"   FontWeight="Bold" FontSize="22" />
 <TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,10,0" x:Name="TxtBox_cCPostal" TextWrapping="Wrap" Text="{Binding m_strFonction}" />
</Grid>

I know i need to use ColumnSpan but i tried and no result :(

Thank You!



Alex Leblois
Alex Leblois

Total Post:67

Points:471
Posted on    October-14-2013 7:54 AM

Try adding Grid.ColumnSpan in the last TextBlock and remove the Grid.Column="0" :

<TextBlock  Grid.ColumnSpan="2" Grid.Row="1"  Margin="0,0,10,0" x:Name="TxtBox_cCPostal" TextWrapping="Wrap" Text="{Binding m_strFonction}" />

Don't want to miss updates? Please click the below button!

Follow MindStick