How to Contain Textblock Contents in my Grid Column? RRS feed

  • Question

  • Hi All,

    I'm developing my first SL4 business application and have a layout issue.  My goal is a 3-column layout in the main viewspace of the page.  To accomplish this, I used a Grid control, set my columns and placed StackPanels in each column.  Within each StackPanel, I've placed TextBlocks with wordwrap = true.  When I run my app, the contents of the left column run into the middle column etc.  How can this be prevented?



    <Grid Margin="0,62,0,8">
                		<ColumnDefinition Width="Auto" MinWidth="116"/>
                		<ColumnDefinition Width="Auto" MinWidth="376"/>
                		<ColumnDefinition Width="Auto" MinWidth="148"/>
    				<StackPanel Grid.Column="0" HorizontalAlignment="Left">
    					<TextBlock FontFamily="Verdana" HorizontalAlignment="Left">
    						Current Statistics
    						Users Online:
    				<StackPanel Grid.Column="1" HorizontalAlignment="Center">
    				<StackPanel Grid.Column="2" HorizontalAlignment="Right">
    					<TextBlock FontFamily="Verdana" FontWeight="Bold" HorizontalAlignment="Right">
    						Latest News:


    Friday, October 8, 2010 6:32 PM


  • I do not see in the xaml that the word wrap has been set.  You should set the textblocks width if you want the word wrap to work

    Friday, October 8, 2010 7:42 PM