ColumnView.CancelUpdateCurrentRow() Method
Cancels changes made to focused row cells.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
#Remarks
Call the CancelUpdateCurrentRow method to discard changes made to cell contents within a focused row. Note that this method is in effect until the row loses focus and if no cell is being edited at present time. To discard changes made to the currently edited cell and close the editor, call the ColumnView.HideEditor method instead.
The ColumnView.UpdateCurrentRow method saves changes made to the focused row. After this method has been called, the CancelUpdateCurrentRow method has no effect.
End-users can also cancel focused row updates. The ESC key must be pressed for this purpose.
Records must implement the IEditableObject interface to enable rollback.
Note
Detail pattern Views do not contain data and they are never displayed within Xtra
- Grid
Control. - returns the top most View in a grid;Main View - Grid
Control. - returns the focused View;Focused View - Grid
Control. - returns the currently maximized View;Default View - the sender parameter of View specific events;
- Grid
View. - returns a detail clone View for a specific master row.Get Detail View
#Example
The code below discards changes made to the focused record by calling the ColumnView.CancelUpdateCurrentRow
method. If an editor is opened for a specific record cell, it is closed while discarding the user’s modifications.
ColumnView view = (ColumnView)gridControl1.FocusedView;
if (view.IsEditing)
view.HideEditor();
view.CancelUpdateCurrentRow();