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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:05:30+00:00 2026-06-03T19:05:30+00:00

I need to do a ListView that has a single column, where this colum

  • 0

I need to do a ListView that has a single column, where this colum is an Expander.

In particular I have a class like this:

public class MyItemT
{
    public string Title { get; set; }
    public TextBlock Info { get; set; }
}

And a list of these objects:

List<MyItemT> Mylist = new List<MyItemT>();

I need to fill the ListView with Expander objects, where the Header it’s binded with Title and the Content with the Info property.

For example a ListView of Expander like this:

<Expander Header="My Expander">
   <TextBlock TextWrapping="Wrap">
      Lorem ipsum dolor sit amet, consectetur
      adipisicing elit, sed do eiusmod tempor incididunt ut
      labore et dolore magna aliqua
   </TextBlock>
</Expander>

My Expander

… and so on (many as there are elements of my ListView) …

The ListView should not have the header bar, and of course everything would be done programmatically.

How it should be done?
Thanks.

  • 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-03T19:05:31+00:00Added an answer on June 3, 2026 at 7:05 pm

    Just define an ItemTemplate for your ListView and place an Expander inside. This at least works for other controls inside an ListView, so it should work here as well.

    <ListView ItemsSource="{Binding YourSource}" Name="listView">
      <ListView.ItemTemplate>
        <DataTemplate>
          <Expander Header="{Binding Title}">
            <TextBlock TextWrapping="Wrap" Text="{Binding Info}" />
          </Expander>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
    

    The binding can also be done via code like this.

    List<MyItemT> Mylist = new List<MyItemT>();
    listView.ItemsSource = Mylist;
    

    One thing you gotta change is the type of your Info property, it should be of type string.

    Oh, and your class should implement INotifyPropertyChanged, otherwise the binding will not always work correctly.

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

Sidebar

Related Questions

I have am generating a listView that looks like this Now, on the click
I have one SubjectTabActivity and i need to show listview on this activity. But
Need help. It may be weird. First activity has listview(like lazyadapter) once i click
I have a listview, and I need to fix the column width of the
I have a ListView that has a FileUpload control and a button in each
I have a ListView that has some minor visual preferences that are set in
I have a C#, WPF ListView that has checkbox and a string in each
Lets say I inherit a class, that has several public properties and/or methods, however
I have a parent window which has a ListView that is bound to an
I have a ListView that displays comments for an article. Each comments has a

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.