Skip to main content

SpreadsheetControl.CellCancelEdit Event

Occurs before the cell editor is closed and the entered value is rolled back.

Namespace: DevExpress.Xpf.Spreadsheet

Assembly: DevExpress.Xpf.Spreadsheet.v23.2.dll

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public event CellCancelEditEventHandler CellCancelEdit

Event Data

The CellCancelEdit event's data class is SpreadsheetCellCancelEditEventArgs. The following properties provide information specific to this event:

Property Description
Cell Gets the cell for which the event is fired. Inherited from SpreadsheetCellEventArgsBase.
ColumnIndex Gets the index of the column that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
Formula Gets the formula that is currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
FormulaInvariant Gets the formula in the invariant culture that is currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
RowIndex Gets the index of the row that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
SheetName Gets the name of the worksheet that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
Value Gets the value currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
Worksheet Gets the worksheet that contains the cell. Inherited from SpreadsheetCellEventArgsBase.

Remarks

Handle the CellCancelEdit event to perform any actions before the cell editor (the cell in-place editor or formula bar) is closed to rollback the entered value (when an end-user presses ESC or the SpreadsheetControl.CloseCellEditor method is called with the passed CellEditorEnterValueMode.Cancel parameter).

The Cell parameter provides access to the cell for which the cell editor is activated. The Value and Formula parameters return a value and formula currently contained in this cell.

Before the cell editor is closed and the entered cell value is committed (for example, when an end-user completes the cell value input by clicking outside the edited cell, or pressing ENTER, CTRL+ENTER or CTRL+SHIFT+ENTER, or the SpreadsheetControl.CloseCellEditor method is called with a passed parameter value other than CellEditorEnterValueMode.Cancel ), the SpreadsheetControl.CellEndEdit event occurs.

To perform any actions before the cell editor is activated, handle the SpreadsheetControl.CellBeginEdit event.

After the cell content has been changed via the SpreadsheetControl UI, the SpreadsheetControl.CellValueChanged event occurs. You can specify whether this event should occur each time a new value is committed to a cell, or only if the committed value differs from the value before editing. This option is accessible via the SpreadsheetCellEditorBehaviorOptions.CommitMode property.

See Also