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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:31:24+00:00 2026-05-28T04:31:24+00:00

I have collection which is bounded to datagrid in WPF UI. My requirement is

  • 0

I have collection which is bounded to datagrid in WPF UI.

My requirement is like i have to update the the value of a property 10 times a second for every item in collection.

So i have taken ConcurrentBag type collection. After updating the value for every item. I am firing RaisePropertyChange explicitly. But UI is not changing.

private void timer_Elapsed(object sender, ElapsedEventArgs e)
{
    if (stockCollection != null)
    {
        stockCollection.ToList().ForEach((s) => s.Price = DateTime.Now.Millisecond);
        Action raiseStockCollectionProperty = new Action(() => RaisePropertyChangedEvent("StockCollection"));
        Dispatcher.BeginInvoke(raiseStockCollectionProperty);
    }
}
  • 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-28T04:31:24+00:00Added an answer on May 28, 2026 at 4:31 am

    I don’t think that the previous answer will provide a solution to your issue. You are in fact not updating the collection at all: You are updating a property of all the Stock instances in the collection. Updating the collection means adding or removing items in it. As the semantics are different, it’s possible that the bound control won’t check the properties of already existing objects in the collection when you fire a CollectionChanged event. It would be a sensible optimization.

    I would suggest you to implement INotifyPropertyChange in your Stock class, and to fire the propertyChanged event here (on the good thread however, using Dispatcher) in the Price property setter.

    private DateTime _price;
    public DateTime Price
    {
       get
       {
         return _price;
       }
       set
       {
         if(_price!=value)
         {
           _price = value;
           RaisePropertyChanged("Price");
         }
       }
    }
    protected void RaisePropertyChanged(string property)
    {
       var propertyChanged = PropertyChanged;
       if(propertyChanged!=null)
       {
         propertyChanged(this,new PropertyChangedEventArgs(property));
    
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a collection in which each each item has a property ID. There
In my WPF application, I have a collection to which I would like to
I have a collection of objects to which I'd like to just add a
Imagine you have a collection of items (say A) around 50,000 but every item
I have an observable collection which is binded to datagrid... I want to sort
I have a listbox which is bounded to an observable collection. The elements in
I have a collection on which I call .par , like this: myCollection.par.map(element =>
We are currently implementing a solution where we have a collection which we want
In my application, I have three collection objects which store data. The data which
I have a collection of objects which describe an image-name, its size and it's

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.