Search code examples
c#wpfdatagrid

How Do I refresh window in wpf?


I have a small project I am working on which is a window with 4 WPF tabs on it.

The first tab is where I do most of the work, but occasionally I need to move back to other tabs. One of these tabs has a DataGrid that is bound to a list that is affected by the main tab I stay on.

When I update something on the first tab, I need it to cause a refresh on the data in the Datagrid(usually just to update a value).

The only way it has been working is if I click on the header myself.

How can I do this in code?

Thanks


Solution

  • Is the list an ObservableCollection or properties implementing INotifyPropertyChanged?

    Have you tried:

    myDatagrid.Items.Refresh();