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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:16:04+00:00 2026-05-27T00:16:04+00:00

The Situation I’m getting the following inconstant behavior on my application: One in about

  • 0

The Situation

I’m getting the following inconstant behavior on my application: One in about 20 executions, a WPFToolkit’s DataGrid which is bound to a DataTable won’t render all the rows, missing anything between 1 to 3 of the whole 4 rows that were expected.

Inner Workings

  • The DataGrid is bound to a DataTable, D1, which is a property of a custom class, C1.
  • When the user stimulates the view, we must retrieve the data from the back-end, which can take time. To do so, we create a thread (actually, we use BackgroundWorker for that but there seems to be no difference from using one or the other), which runs a method, M1, that opens the connection and request the data. The thread is used to avoid having an unresponsive application.
  • M1 retrieves data and stores it on a DTO first. After that, he asks C1 to clear it’s table. C1 does so (by calling a D1.Clear()) and raises NotifyPropertyChanged() (from the thread).
  • M1 passes the new backend’s DataTable to C1, which inserts row by row into D1. After finishing inserting the rows, C1 raises NotifyPropertyChanged(). The thread exits.

So, in other words, I clear the table, notify WPF, insert the data, notify WPF and exit.

In my view, as long as the last Notify is correctly consumed from the UI, it should always show all the rows.

Besides the DataTable, there are a large number of properties (mostly strings and int) being update and thus notified. We have not observed this behavior in any other case, only with the DataTable.

I know this goes deep into WPF mechanisms for binding, but I hope anyone can shed a light here. Any information about WPF binding or multi-threading with WPF is welcome.

  • 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-27T00:16:04+00:00Added an answer on May 27, 2026 at 12:16 am

    DataTable pre dates WPF and thus doesn’t implement INotifyCollectionChanged which is how WPF monitors for collection changes. You have two options:

    1. Replace the existing DataTable with a new DataTable (after you have set the rows). Then fire the property changed notification.
    2. Change from a DataTable to an ObservableCollection. The collection will fire a change notification anytime you change the list of items. (Note it will not fire if you change the contents of one of the items already in the list)

    INotifyPropertyChanged notifies when the property has changed, not when the internal state (be it a property or collection) have changed. When you fire the Property Changed event WPF only rebinds the controls if the property is a different object from the last time it bound the data. This keeps it from refreshing the whole screen when you only change one property several layers down in an object graph.

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

Sidebar

Related Questions

Situation In my Wicket application, I have a page which contains two tags. Each
Situation is you have to develop an application against an Active Directory Tree. Want
Situation: I am using the Navigation Based Application project template. And my root view
Situation: I have an Xcode project based on the Navigation-Based-Application template. So that means
Situation: One WebApplication, two site collections. Both site collections have the same type and
Situation: a main form calls a modal jDialog with textboxes in which parameters are
Situation: there's a table that is managed by application A. Application A inserts and
Situation: In my database I have a table in which records may reference other
[Situation] I have a custom item control which I add to a stack panel
Situation: I have a multithreaded program written in C. If one of the threads

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.