Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPf bound DataGrid - how to block DataGRid updates

$
0
0

Hi,

I have two VIEW/VIEWMODEL pairs (MASTER & DETAILS) based on the same MODEL. Both VIEWs have a DataGrid bound to an ObservableCollection in the common model via the two VIEWMODELs. When i have the DEATILS VIEW open, I don't want the MASTER VIEW/VIEWMODEL to reflect any changes made in the DETAILS VIEW/VIEWMODEL until the changes are committed.

However, if e.g. I add a new row in the DETAILs DataGrid, which is reflected in the common MODEL, the MASTER DataGrid is updated synchroniously. Basically this is exactly what the MVVM would do automaticcaly using the binding mechanism, but I want to suspend this inherited behaviour (while the DETAILs are open and changes are uncommitted).

I can block the events raized in my own code using OnPropertyChanges (e.g. when a new row is selected), but i can't block any shanges made to the cell content, or if the content of the ObservableCollection is changed. Apparently such changes are updated in both bound DataGrids by internal events that are not sent through the propertyChanged eventhandler i have implemented in my MASTER VIEWMODEL.

Any help is greatly appreciated.

Thanks

Erik


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>