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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:48:46+00:00 2026-05-17T02:48:46+00:00

I am binding a WPF application DataGrid to an ObservableCollection via the DataGrid’s ItemSource.

  • 0

I am binding a WPF application DataGrid to an ObservableCollection via the DataGrid’s “ItemSource”. Initially the DataGrid does come up with headings and values, however the upgrades made to the ObservableCollection are not reflected? (i.e. when I come back programmatically and increase the “Total” value) The ObservableCollection I am using is below.

Any ideas why & how to get the grid to dynamically update/bind correctly?

public class SummaryItem
{
    public string ProcessName { get; set; }
    public long Total { get; set; }
    public long Average { get; set; }

    public static SummaryItem ObservableCollectionSearch(ObservableCollection<SummaryItem> oc, string procName)
    {
        foreach (var summaryItem in oc)
        {
            if (summaryItem.ProcessName == procName) return summaryItem;
        }
        return null;
    }
}

EDIT – Or perhaps an add-on question is whether in this case DataGrid isn’t the control I should be using to visualize what is effectively an in-memory table? That is the observableCollection of SummaryItem’s is effectively the in-memory table.

  • 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-17T02:48:47+00:00Added an answer on May 17, 2026 at 2:48 am

    If I see it right you are using an ObservableCollection. If you add items to the ObservableCollection these changes should always been reflected by WPF, but if you edit properties on an item (i.e. changing the “Total” value of a SummaryItem) this is no change to the ObservableCollection but to the SummaryItem.

    To achieve the desired behaviour your SummaryItems have to implement the INotifyPropertyChanged interface to “notify” WPF when propertys are changed:

    // implement the interface
    public event PropertyChangedEventHandler PropertyChanged;
    
    // use this for every property
    private long _Total;
    public long Total {
        get {
            return _Total;
        }
        set {
            _Total = value;
            if(PropertyChanged != null) {
                // notifies wpf about the property change
                PropertyChanged(this, new PropertyChangedEventArgs("Total"));
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MVVM to bind a ComboBox to an ObservableCollection in my WPF-application. However,
I have used ObservableCollection for DataBinding in my WPF application where I am binding
I have created WPF MVVM application, and set WPFToolkit DataGrid binding to DataTable so
I have written a simple wpf application for binding data in datagrid. It throws
In a WPF application I have a ListView: <ListView Name=ItemSelList ItemsSource={Binding ItemColl} SelectionChanged=ItemSelList_SelectionChanged> <ListView.View>
I'm finding it challenging to get data-binding working for my sample WPF application in
I'm building an MVVM application in WPF and I am binding a Menu to
What does {Binding Path=.} mean in a WPF binding? I see some people use
I have a WPF application with a datagrid who's ItemsSource is a BindingList. When
I am making a WPF-application.I have a datagrid with a column header that contains

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.