Skip to content

Instantly share code, notes, and snippets.

@caleb-vear
Created November 15, 2012 01:55
Show Gist options
  • Save caleb-vear/4076162 to your computer and use it in GitHub Desktop.
Save caleb-vear/4076162 to your computer and use it in GitHub Desktop.
Grid auto column width text wrapping fail.
<Window x:Class="TestGridTextWrapping.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid Width="525">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock TextWrapping="WrapWithOverflow">
Blah blah blah blah some really long text that will need to wrap, but stupidly will not. I can't quite understand why the grid is letting the TextBlock measure with infinite width.
</TextBlock>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment