Skip to content

DevExpress-Examples/winforms-grid-undo-changes-in-edited-row

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Data Grid - Cancel current row modifications at the GridView level

Windows Forms binding allows you to discard changes made in a data item (row/record). This feature is available for data objects that implement IEditableObject (CurrencyManager.CancelCurrentEdit).

Entity Framework 4 comes with POCO support that allows developers to define entities (base classes are not required). By not inheriting from the underlying entities of the framework, developers lost the built-in implementations of IEditableObject and INotifyPropertyChanged interfaces (for example, the capability to undo changes to a grid control if data validation fails).

This example demonstrates how to address this issue at the GridView level. The example creates a custom Grid View. The custom GridView uses a new data controller (inherited from the CurrencyDataController class) and overrides the following methods: BeginCurrentRowEdit, EndCurrentRowEdit, and CancelCurrentRowEdit.

Files to Review