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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:19:28+00:00 2026-06-13T16:19:28+00:00

I have a very simple WPF ListView that I’m using to list blocks of

  • 0

I have a very simple WPF ListView that I’m using to list blocks of text. I’d like it to scroll vertically, but the text should wrap so that there is no horizontal scroll. All the examples I’ve seen are overly convoluted DataGridView nesting solutions. This seems like such a simple use-case, however. Here is my current code:

<ListView  
        Height="Auto"
        Width="Auto"
        Margin="0"
        Name="mLogListView" 
        FontWeight="Bold"
        FontSize="16"
        SelectionMode="Single"
        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
        HorizontalContentAlignment="Stretch"/>

I’ve tried setting the ScrollViewer.HorizontalScrollBarVisibility and HorizontalContentAlignment properties but the text simply runs off the end of the control and doesn’t wrap.

Each item is added to the ListView.Items collection and is a ListViewItem object. The text is set to the item’s Content property.

Here is the code responsible for adding text times to the list:

ListViewItem item = new ListViewItem();            
item.Content = "Item text is set here, but refuses to wrap in list view!";
mLogListView.Items.Add(item);

Thank you.

  • 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-13T16:19:29+00:00Added an answer on June 13, 2026 at 4:19 pm

    This should be what you need

    <ListView Margin="12,23,309,191"
            Name="mLogListView" 
            FontWeight="Bold"
            FontSize="16"
            SelectionMode="Single"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
            HorizontalContentAlignment="Stretch" >
    <!-- here set the itemTemplate to a TextBlock that can wraps-->
            <ListView.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=.}" TextWrapping="Wrap"></TextBlock>
                </DataTemplate>
            </ListView.ItemTemplate>
    </ListView>
    

    Note the syntax Text="{Binding Path=.}" that is equivalent to Text="{Binding}". This is called empty binding syntax.

    In this case Text is bound to the entire ListViewItem object. The empty binding syntax is useful when you want to bind to the entire object item instead of just to single property of the item.

    This is convenient for the example because the source object (the ListViewItem) is of type string and you simply want to bind to the string itself.

    For more information see msdn at section Specifying the Path to the Value

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

Sidebar

Related Questions

I have a very simple list of objects that represt people. Each object has
I have a very simple WPF user control that is mixed in with a
I have a very simple WPF application in which I am using data binding
I'm using Console.WriteLine() from a very simple WPF test application, but when I execute
I have a very simple set of styles that I'm using in a couple
I'm trying to create a very simple WPF application. I'd like to have an
I am working on a very simple stopwatch using WPF but using the System.Diagnostics
Say I have a very simple WPF grid (6 rows x 6 columns) defined
I have a VERY simple 3D space defined in WPF, which defines a 3D
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();

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.