R – Does anyone have code examples of the WPF Datagrid working in a MVVM pattern


I got the following example of a WPF DataGrid bound to a ViewModel in a MVVM pattern, but it is read-only:

MVVM example which has buttons that switch the data in the ViewModel

I tried to extend it so that the DataGrid was bound to an observable collection of ViewModels so that editing cells would fire OnPropertyChanged events on the appropriate ViewModels but couldn't get it to work the way I wanted.

Does anyone know of a code example that does this, i.e. binding the DataGrid not to a collection of ViewModels with OnPropertyChanged properties and Delegate Commands, etc.?

Best Solution

Jaime Rodriguez and Karl Schifflett are doing a MVVM training roadshow. They have developed a demo application (which uses a datagrid) maybe you want to look into that applicatoin as well as the docs...


Related Question