Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8273653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:32:26+00:00 2026-06-08T07:32:26+00:00

I have a StackPanel, but the following line : <TextBlock Grid.Row=1 Grid.Column=0 Text={Binding Notes}

  • 0

I have a StackPanel, but the following line :

<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Notes}" TextWrapping="Wrap"  />

is not Wrapping the Text.

<StackPanel Orientation="Vertical">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="15" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <DockPanel Grid.Row="0" Grid.Column="0">
            <TextBlock FontWeight="Bold" Padding="0,0,5,0" Text="{Binding Path=Id, StringFormat='#\{0\}'}" />
            <TextBlock FontWeight="Bold" Padding="0,0,5,0" Text="{Binding Path=Name}" />
        </DockPanel>
        <TextBlock Grid.Row="0" Grid.Column="4" FontWeight="Bold" Text="{Binding Path=Time, StringFormat={}{0:HH:mm}}" />
        <Image
            Grid.Row="0"
            Grid.Column="6"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Source="{Binding Path=Image, Mode=OneWay, Converter={StaticResource ImageConverter}}" />

        <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Notes}" TextWrapping="Wrap" />

        <Image
            Grid.Row="1"
            Grid.Column="4"
            HorizontalAlignment="Center"
            VerticalAlignment="Top"
            Source="{Binding Path=Picture, Mode=OneWay, Converter={StaticResource PictureConverter}}" />
    </Grid>
</StackPanel>

The StackPanel Orientation is set to ‘Vertical’ but the TextBlock is not inheriting it.

Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:32:27+00:00Added an answer on June 8, 2026 at 7:32 am

    Your problem is using the StackPanel that allows its children to fill in all the available space – the StackPanel stretches accordingly to the size of its content. Try removing the StackPanel and keep just the Grid – this way you will limit the size of its children to the available space used by the Grid.

    If that isn’t enough in the layout you’ve built, try setting a MaxWidth on the TextBox that needs wrapping.

    Now the source of your problem was also the fact that your TextBox was inserted in the first Column of the Grid that had an infinite size (Width=”Auto”). Thus, setting the Grid.Column=”7″ to the TextBox did the trick you wanted (wrapping text). Here’s the revised code:

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="15" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
    
        <DockPanel Grid.Row="0" Grid.Column="0">
            <TextBlock FontWeight="Bold" Padding="0,0,5,0" Text="{Binding Path=Id, StringFormat='#\{0\}'}" />
            <TextBlock FontWeight="Bold" Padding="0,0,5,0" Text="{Binding Path=Name}" />
        </DockPanel>
        <TextBlock Grid.Row="0" Grid.Column="4" FontWeight="Bold" Text="{Binding Path=Time, StringFormat={}{0:HH:mm}}" />
        <Image
            Grid.Row="0"
            Grid.Column="6"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Source="{Binding Path=Image, Mode=OneWay, Converter={StaticResource ImageConverter}}" />
    
        <TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="7" Text="{Binding Notes}" TextWrapping="Wrap" />
    
        <Image
            Grid.Row="1"
            Grid.Column="4"
            HorizontalAlignment="Center"
            VerticalAlignment="Top"
            Source="{Binding Path=Picture, Mode=OneWay, Converter={StaticResource PictureConverter}}" />
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xaml with all the binding removed; <StackPanel Grid.Row=2 Grid.Column=1 Orientation=Horizontal
I have the following structure in XAML: <Grid> <ItemsControl x:Name=Items ItemsSource={Binding Path=Pages} Grid.Row=0 Grid.Column=0>
I have the following stack panel <StackPanel> <TextBlock Text={Binding AddressLine1} /> <TextBlock Text={Binding AddressLine2}
I have the following TabControl: <TabControl x:Name=Networks> <TabControl.ItemTemplate> <DataTemplate> <StackPanel Orientation=Horizontal> <TextBlock Text={Binding DisplayName}
I have a combo box with the following DataTemplate: <DataTemplate x:Key=ComboBoxDataTemplate> <StackPanel> <TextBlock Text={Binding
I have the following layout in XAML: <StackPanel Height=40> <TextBlock TextWrapping=Wrap TextTrimming=WordEllipsis Margin=0,10,0,10 LineHeight=18
Given that we have the following View: <StackPanel> <TextBlock Text=Some text/> <Image Source={Binding vmImageProp}
I have the following code in my DataGridTemplateColumn: <Controls:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <StackPanel Orientation=Horizontal> <TextBox Text={Binding
I have the following ItemTemplate: <ItemsControl ItemsSource={Binding Topics}> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation=Horizontal Margin=10,0> <TextBlock
Within my Windows.Resources I have the following column defined: <DataGridTextColumn x:Key=CustomColumn x:Shared=False> <DataGridTextColumn.Header> <StackPanel>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.