TEXT WRAPPING NOT WORKING IN WPF.

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
WPF 
WPF
 1513  View(s)
Ratings:
Rate this:
HI mindstick!

I got this XAML code and I've been trying to get it working for a few hours now (I'm pretty new to WPF). I basically want the text in the TextBlock to line break if there's not enough room for it.

<Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="60" />

    <ColumnDefinition Width="*" />

  </Grid.ColumnDefinitions>

  <Image Source="{Binding Path=imageurl}" Width="60" Height="60" Grid.Column="0" />

  <TextBlock TextWrapping="Wrap" Text="{Binding Path=content}" Grid.Column="1" />

</Grid>

Thanks!

  1. shreesh chandra shukla

    Post:105

    Points:735
    Re: Text wrapping not working in wpf.

    Hi!

    you may try this

    I basically set the Grid ColumnDefinition width to a fixed one and it works now.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!