Version

EditModeValidationError Event

Invoked when the XamSpreadsheet is exiting edit mode and the new value for the ActiveCell is not valid based on the criteria of that cell's Infragistics.Documents.Excel.DataValidationRule.
Syntax
'Declaration
 
Public Event EditModeValidationError As EventHandler(Of SpreadsheetEditModeValidationErrorEventArgs)
public event EventHandler<SpreadsheetEditModeValidationErrorEventArgs> EditModeValidationError
Event Data

The event handler receives an argument of type SpreadsheetEditModeValidationErrorEventArgs containing data related to this event. The following SpreadsheetEditModeValidationErrorEventArgs properties provide information specific to this event.

PropertyDescription
Action Returns or sets the action to take in response to the failed validation.
CanStayInEditMode Returns a boolean indicating whether the cell is allowed to stay in edit mode.
Cell Returns the cell for which the control has entered edit mode.
ValidationRule Returns the rule which failed validation.
Remarks

The EditModeValidationError is raised while exiting edit mode if the new value for the ActiveCell is not valid based on the criteria of that cell's Infragistics.Documents.Excel.DataValidationRule. Since the rule needs to evaluate the value of the cell and potentially other cell's in the Worksheet, the value is first applied to the cell(s) and then is validated. By default if the event is not handled and the Infragistics.Documents.Excel.DataValidationRule.ShowErrorMessageForInvalidValue is true, a message box will be displayed to the end user to determine what action to take. One can handle this event and specify the action that should be taken using the SpreadsheetEditModeValidationErrorEventArgs.Action.

Note: The validation rule will not be evaluated if edit mode is being cancelled such as when the user presses Escape to cancel edit.

Note: The SpreadsheetEditModeValidationErrorEventArgs.Action will default to AcceptChange if the ShowErrorMessageForInvalidValue of the SpreadsheetEditModeValidationErrorEventArgs.ValidationRule is false; otherwise it will default to ShowPrompt.

Note: Like Microsoft Excel, only the validation rule of the active cell is considered even if the update is affecting other cells in the selection.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

XamSpreadsheet Class
XamSpreadsheet Members
Infragistics.Documents.Excel.DataValidationRule