Search code examples
wpfmvvmdatagrideditingpersist

How to persist changes in datagrid after each change?


I have a DataGrid which is bound to an array of data objects. How do I persist changes (save updated values to the database) of the data each time any field is changed? What event should I use?


Solution

  • You can use the DataGrid.CellEditEnding event and do whatever you need to save or validate your data.

    http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.celleditending.aspx