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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:32:03+00:00 2026-05-28T03:32:03+00:00

I am having trouble adding a row that displays all the values of the

  • 0

I am having trouble adding a row that displays all the values of the member of an object.

Here is how I have set up my listview:

    <ListView Height="178" HorizontalAlignment="Left" Margin="238,31,0,0" Name="SpoolSheetListView" VerticalAlignment="Top" Width="555" HorizontalContentAlignment="Stretch" SelectionMode="Single">
        <ListView.View>
            <GridView>
                <GridViewColumn Width="85"  Header="Column 1" />
                <GridViewColumn Width="120" Header="Column 2" />
                <GridViewColumn Width="120" Header="Column 3" />
                <GridViewColumn Width="120" Header="Column 4" />
                <GridViewColumn Width="115" Header="Column 5" />
            </GridView>
        </ListView.View>
    </ListView>

say, myObject has 5 members: member1 to member5, which are all of type string. How do I add a single row in the ListView for that object?

Thanks again people!

  • 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-05-28T03:32:03+00:00Added an answer on May 28, 2026 at 3:32 am

    WPF list controls work best when you use them with data binding; you should bind the ItemsSource of the ListView to a list of objects, and bind each column to a property of these objects.

    <ListView ItemsSource="{Binding Items}" Height="178" HorizontalAlignment="Left" Margin="238,31,0,0" Name="SpoolSheetListView" VerticalAlignment="Top" Width="555" HorizontalContentAlignment="Stretch" SelectionMode="Single">
        <ListView.View>
            <GridView>
                <GridViewColumn Width="85"  Header="Column 1" DisplayMemberBinding="{Binding Member1}" />
                <GridViewColumn Width="120" Header="Column 2" DisplayMemberBinding="{Binding Member2}" />
                <GridViewColumn Width="120" Header="Column 3" DisplayMemberBinding="{Binding Member3}" />
                <GridViewColumn Width="120" Header="Column 4" DisplayMemberBinding="{Binding Member4}" />
                <GridViewColumn Width="115" Header="Column 5" DisplayMemberBinding="{Binding Member5}" />
            </GridView>
        </ListView.View>
    </ListView>
    

    (Items being a property of the DataContext that returns a collection of objects)

    To add a row to the ListView, you just need to add an item to the Items collection (note that the collection should implement INotifyCollectionChanged so that the ListView is notified; the ObservableCollection<T> class works fine for most cases)

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

Sidebar

Related Questions

I am having trouble adding ajax functionality to existing asp.net 4 website. I have
I'm having trouble adding Facebook Connect to my iPhone Project. Here's the directory structure:
I'm having trouble adding a slashed slug and nested routes. If I have these
I'm having trouble adding this <?php echo (set_value('first_name')) ? (set_value('first_name')) : ($row->first_name); ?> to
I'm having trouble adding a button to a layout that I've created in XML.
I'm having trouble adding page numbers to PDFs. Here's how I'm inserting pages /
I'm having some trouble adding a mutable string (that has been changed with replaceOccurrencesOfString)
I'm having trouble adding Javascript as CDATA to .xml files. Is that possible? I'm
I am having trouble adding Widgets to my homescreen. I have created a new,
I'm having trouble adding an event listener. I'm basically encapsulating all keyboard-related functions into

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.