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 9148497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:17:27+00:00 2026-06-17T11:17:27+00:00

I have the following markup: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=Auto /> <ColumnDefinition Width=Auto /> </Grid.ColumnDefinitions>

  • 0

I have the following markup:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>

    <TextBlock x:Name="Col1" Text="Text1" Grid.Column="0" />
    <TextBlock x:Name="Col2" Text="Text12" Grid.Column="1" />
</Grid>

If I put a lot of text in Col1 it exceeds the screen and Col2 could not be seen at all. I would like to change that behavior such that if there’s too much text in Col1 then it’s width gets reduced so that Col2 could be fully seen.

On the other hand if I change markup to this:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>

    <TextBlock x:Name="Col1" Text="Text1" Grid.Column="0" />
    <TextBlock x:Name="Col2" Text="Text12" Grid.Column="1" />
</Grid>

Here are images the illustrate how I want TextBlocks to behave:

Combined width of two TextBlocks is smaller than screen so they go one after another.
enter image description here

First Text block is very long so it is cropped in order to contain second TextBlock within screen.
enter image description here

Then everything is OK when Col1 has a lot of text but when the amount of text is small there is a gap between Col1 and Col2. What should I do to get desired behavior in both situations?

  • 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-17T11:17:29+00:00Added an answer on June 17, 2026 at 11:17 am

    Revised;

    <Grid HorizontalAlignment="Left">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>    
        <TextBlock x:Name="Col1" Text="Text1" />
        <TextBlock x:Name="Col2" Text="Text12" Grid.Column="1" TextWrapping="Wrap" />
    </Grid>
    

    Then Keep in mind to limit their overall size this would be placed in a parent panel container like another 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 markup: <div style=overflow:auto;width:500px;height:100px;> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li>
I have the following markup. @(Html.Telerik().Grid(Model) .Name(Grid) .DataKeys(keys => keys.Add(key => key.Id)) .Columns(columns =>
I have the following markup: <input id=displayBuffer type=hidden> <textarea id=about rows=2 name=about cols=20 aria-hidden=true><p>test</p></textarea>
I have the following markup:- <select name=a id=a> <option>Option 1</option> <option>Option Bottom</option> <option>Option 2</option>
I have the following markup. I would like to add class_A to <p class=subitem-text>
I have the following markup: <div class="header">Text</div> <div class="hiddenArea">sdsada</div> <div class="header">Text2</div> <div class="hiddenArea">sdsada</div> and
I have the following markup: <select multiple=multiple id=targetFilesList style=width:200px;height:110px;> </select> <input type=button value=Get id=btnGet
i have a rad grid with the following code <telerik:GridTemplateColumn> <ItemTemplate> <asp:LinkButton ID=Delete Text=Remove
I have following markup: <div class=container> <div class=left-rect></div> <div class=text>Lorem ispum</div> <div class=right-rect></div> </div>
I have the following markup: <li id=CN2787> <img class=fav_star src=images/fav.png> <span>Text, text and more

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.