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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:14:50+00:00 2026-06-16T01:14:50+00:00

I have WPF project based on MVVM. In my view I have the next

  • 0

I have WPF project based on MVVM. In my view I have the next ListBox

<ListBox BorderBrush="#6797c8" BorderThickness="2" 
    ItemsSource="{Binding  Path=CategoriesDS}" 
    DisplayMemberPath="MainCategories/Category"/>

And this is my code at ViewModel:

private DataSet categoriesDS;

public DataSet CategoriesDS
{
    get
    {
        if (categoriesDS == null)
        {
            categoriesDS = _dal.GetCategoriesTables();
        }
        return categoriesDS;
    }
    set
    {
        categoriesDS = value;
        if (this.PropertyChanged != null)
        {
            this.PropertyChanged(this,
                  new PropertyChangedEventArgs("CategoriesDS"));
        }
    }
}

My DataSet contains 2 tables and the first table (“MainCategories”) contains 3 rows.
When I run my app I’m seeing just the first row of “MainCategories” table.

Why is the ListBox showing just 1 row? I want to show the entire table.

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-16T01:14:52+00:00Added an answer on June 16, 2026 at 1:14 am

    You’ll need to bind to the table directly. You can create another property that just accesses the CategoriesDS property and then bind against the new property:

    public DataView MainCategories 
    { 
      get { return CategoriesDS.MainCategories.DefaultView; } 
    }
    

    or

    public DataView MainCategories 
    { 
      get { return CategoriesDS.Tables[0].DefaultView; } 
    }
    

    XAML

    <ListBox BorderBrush="#6797c8" BorderThickness="2" 
        ItemsSource="{Binding  Path=MainCategories}" 
        DisplayMemberPath="Category"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project based WPF and MVVM. My project is based on a
I'm working on project that based on WPF and MVVM. I have some UserControl
I am trying to implement MVVM in a new project (based on WPF &
if try implemnt my first MVVM in WPF app. I have old app based
I am using Microsoft Visual Basic 2010 Express. I have a WPF-based project. I
I have a WPF project based upon Prism Feb 2009 release set up as:
I have a WPF project which compiles just fine. However, when I enable code
I have a WPF project using CM. I have a progress bar that I
I don't even know how to describe this. I have a WPF project that
I have in my WPF project file RssInfo.cs in which I have public class

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.