Observablecollection not updating datagrid


Example: Very simple Observable Collection In this example we will create a new class named Person and a list of persons using Observable Collection.Using a Data Grid we will set only a property Items Source.

observablecollection not updating datagrid-78observablecollection not updating datagrid-6observablecollection not updating datagrid-52observablecollection not updating datagrid-45

You need to replace the entire “Expense” object for you to see the collection change firing up.

An Observable Collection is a dynamic collection of objects of a given type.

Objects can be added, removed or be updated with an automatic notification of actions.

So all we need to do in the XAML file is to specify the binding member for each column.

We can do that by the "Display Member Binding" attribute and "Binding" markup extension.

So far in this tutorial, we have mostly created bindings between UI elements and existing classes, but in real life applications, you will obviously be binding to your own data objects.

You must have an account to comment. Please register or login here!