I have a DataGrid in my WPF application. For this DataGrid I have set ItemSource as below
ItemsSource="{Binding Path=MyItems}"
MyItems is List of MyItem declared in MyViewModel
// ItemsSource for MyItem Grid
public List<MyItem> MyItems {get;set; }
MyItem has set of Properties, Each property is mapped with each column in DataGrid. At initialization I am filling MyItems; So DataGrid is showing MyItems values in each column.
In a button command, I am creating a Worker thread, Worker thread modifies properties of MyItems which are shown in the Grid. For example MyItem has a property called "Status" which is binded to a column of grid. The status value is changed in the workerthread. End of the worker thread I am calling
OnPropertyChanged("MyItems"); //force UI refresh
But status column values in the grid is not updating.
Once I click the datagrid column then only the values are refreshing. How to refresh datagrid from worker thread?