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

  • Home
  • SEARCH
  • 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 3954568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:06:56+00:00 2026-05-20T02:06:56+00:00

I have an ObservableCollection bound to a WPF DataGrid. The ObservableCollection is populated and

  • 0

I have an ObservableCollection bound to a WPF DataGrid. The ObservableCollection is populated and updated asynchronously.

The DataGrid is not displaying the correct number of rows. Each time I run the application I get a varying number rows displayed, usually 7-8 but sometimes only one. I get the same behvaior with ListBox, but not with ComboBox.

I get this same behavior with a ListBox and ItemsControl but not with ComboBox. The ComboBox correctly displays all 18 items as expected.

EDIT

This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.

I’ll need to do some more detective work here as my presumption was the updates were happening in the same thread. So the reason for the first few items being displayed correctly is that the ViewModel was able to retrieve some of the data before the View itself loaded.

  • 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-20T02:06:57+00:00Added an answer on May 20, 2026 at 2:06 am

    I can confirm that this is indeed a threading issue. I am an idiot for dumping the exceptions when adding to the collection, because I probably would have spotted the error sooner! Never do this! It is bad pratice.

    Possible solutions to this problem are addressed here:

    ObservableCollection and threading

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

Sidebar

Related Questions

I have a WPF DataGrid bound to ObservableCollection . Each item in my collection
I have a WPF Toolkit DataGrid bound to an ObservableCollection of Car in my
using WPF/C#/Entity Framework. I have a DataGrid.ItemsSource bound to some ObservableCollection . Now, I
In my project I have a WPF Listbox bound to an ObservableCollection. Every time
I have an instance of ObservableCollection bound to a WPF listbox with two separate
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have a WPF ItemsControl that is bound to an ObservableCollection. The XAML: <ItemsControl
I have a ComboBox bound to an ObservableCollection of decimals. What is the correct
I have this ListBox which is bound to an ObservableCollection. Each object in the
I have an ItemsControl whose ItemsSource gets bound to an ObservableCollection<Component> at run time.

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.