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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:33:20+00:00 2026-06-01T03:33:20+00:00

I have a grid view that has two simple columns, a report number and

  • 0

I have a grid view that has two simple columns, a report number and a short description. It is common for this short description to have some carriage returns. If that is the case, I would like the row to expand its height to fit all of the text in.

Currently the field renders with possibly the first line displaying, but then cutting off text below it. How could I display all the text, with it adjusting the height as needed?

And can this be done on a per-row basis, as in, if the next report did not have a description with carriage returns, it would just show on one line?

It would be rather similar to this question, but in WPF versus ASP.net

This also may due to using a theme application wide. If that is the case, how can I enforce it only in this grid view?

XAML:

Originally I had it only as

<GridViewColumn Width="365" Header="Desc" DisplayMemberBinding="{Binding desc}" />

I have also tried

<GridViewColumn x:Name="colDesc" Header="Desc" Width="75" >
     <GridViewColumn.CellTemplate>
          <DataTemplate>
              <TextBlock Text="{Binding Desc}" />
          </DataTemplate>
     </GridViewColumn.CellTemplate>
</GridViewColumn>

We are using an application wide theme, that very well may be setting the high explicitly. If so, I am leaning mostly towards the fact (From the comments) that the theme is overriding a default value for how this works. If so, how do I have it act the way the it is supposed to (again, from the comments, it sounds like this is the default behavior).

Using the second example, here is what it looks like:

enter image description here

In here it looks like the text is larger, so again, I would want the cell to adjust to the hight needed. And some of these have multiple lines, so as you can see I would not see the remaining content. I have also tried to set the Height on the text block, but that had no effect.

  • 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-01T03:33:21+00:00Added an answer on June 1, 2026 at 3:33 am

    This worked.

     public string TextBlockText { get { return "one line \r\ntwo line"; } }
    
     <TextBlock Height="Auto" Width="100" HorizontalAlignment="Left" Text="{Binding Path=TextBlockText}" />
    

    I will leave it to you on how to put a TextBlock in a ListView.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET GridView which has columns that look like this: | Foo
I have a custom component, ExportCommandButton, that has two attached properties. This component is
I have a grid view that has a check box column, and I want
I currently have a gridview that has an asp:ButtonField as one of the columns.
I have used a list view that uses a grid view in WPF. I
I have a Data Grid View inside a control that is displayed in a
I currently have a product view page that contains an MVCContrib HTML Grid with
hi i have two xml file and i want to bind grid view eith
Using 4.0.6 I have a gridpanel with an actioncolumn that has two items, a
So I've got a pretty basic ListView, that has two columns. Sample code below:

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.