officefileapi-devexpress-dot-xtraspreadsheet-dot-spreadsheetcelleventargs-de318eda.md
Identifies an action which caused a change of the cell value.
Namespace : DevExpress.XtraSpreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public CellValueChangedAction Action { get; }
Public ReadOnly Property Action As CellValueChangedAction
| Type | Description |
|---|---|
| CellValueChangedAction |
A CellValueChangedAction enumeration value identifying an action.
|
Available values:
| Name | Description |
|---|---|
| Edit |
End-user has modified the cell value using worksheet editors.
| | UndoRedo |
Cell value has been changed by executing the undo or redo command.
| | Paste |
New value has been pasted into the cell.
| | API |
Cell value has been modified programmatically.
|
Use the Action property to determine whether a change of the cell value is caused by end-user editing, an undo/redo operation or a programmatic cell value modification.
Tip
The WorkbookEventOptions.RaiseOnModificationsViaAPI option should be set to true to raise the SpreadsheetControl.CellValueChanged or SpreadsheetControl.CellValueChanged event when the cell value is modified programmatically.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Action property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L134
void spreadsheetControl1_CellValueChanged(object sender, SpreadsheetCellEventArgs e) {
if (e.Action == CellValueChangedAction.UndoRedo || e.OldValue == e.Cell.Value ||
e.Cell.GetReferenceA1(ReferenceElement.IncludeSheetName) != "Invoice!B10")
winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L124
Private Sub spreadsheetControl1_CellValueChanged(ByVal sender As Object, ByVal e As SpreadsheetCellEventArgs)
If e.Action = CellValueChangedAction.UndoRedo OrElse e.OldValue Is e.Cell.Value OrElse Not Equals(e.Cell.GetReferenceA1(ReferenceElement.IncludeSheetName), "Invoice!B10") Then Return
Dim invoice As Worksheet = e.Worksheet
See Also
SpreadsheetControl.CellValueChanged
SpreadsheetControl.CellValueChanged
SpreadsheetCellEventArgs Class