Back to Devexpress

SpreadsheetControl.CellCancelEdit Event

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-88305316.md

latest5.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Spreadsheet

Declaration

csharp
public event CellCancelEditEventHandler CellCancelEdit
vb
Public Event CellCancelEdit As CellCancelEditEventHandler

Event Data

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

PropertyDescription
CellGets the cell for which the event is fired. Inherited from SpreadsheetCellEventArgsBase.
ColumnIndexGets the index of the column that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
FormulaGets the formula that is currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
FormulaInvariantGets the formula in the invariant culture that is currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
RowIndexGets the index of the row that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
SheetNameGets the name of the worksheet that contains the cell. Inherited from SpreadsheetCellEventArgsBase.
ValueGets the value currently contained in the cell. Inherited from SpreadsheetCellEventArgsBase.
WorksheetGets 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

CellEndEdit

CellBeginEdit

CellEditorOpened

CellValueChanged

SpreadsheetControl Class

SpreadsheetControl Members

DevExpress.Xpf.Spreadsheet Namespace