I have set the ItemSource property to an Enumerable Collection (which is changing dynamically by our Entity-Framework). I have created the columns manually (because I want to show only a subset of the data). At first, the data is displayed according to the enumerable. When I change something via the DataGrid, it doesn’t update the enumerable member. Only when I sort (or move) the columns, the enumerable gets its update. The same happens in the opposite direction – if the collection changes, it only updates the DataGrid when re-sorting or moving the columns seperator.
I would like to have dynamic-binding, i.e. update the collection whenever our user changes something through the DataGrid, and update the DataGrid whenever our collection changes.
For the DataGridControl to receive change notifications from the Data Source, the Data Source needs to implement either IBindingList or INotifyCollectionChanged. I also recommend encapsulating the Data Source within a DataGridCollectionView to benefit from several optimizations made ( grouping, sorting, insertion, … ).
For the DataGridControl to receive change notifications from the elements within the Data Source, the elements need to implement INotifyPropertyChanged or use DependencyProperties (through base class DependencyObject).
Imported from legacy forums. Posted by Marcus [Xceed] (had 2766 views)