Version

Invalid Value Behavior

Specifies the behavior when the user attempts to leave a cell after entering an invalid value. The InvalidValueBehavior property has the following members:

  • Default - Default is resolved to RetainValueAndFocus.

  • RetainValueAndFocus - Retains the value entered by the user and also keeps the cell in edit mode.

  • RevertValue - Reverts the value back to the original value. The cell does not stay in edit mode.

  • RevertValueAndRetainFocus - Reverts the value back to the original value and the cell is kept in edit mode.

The functionality to control the behavior when the user attempts to leave a cell after entering an invalid value already existed prior to implementation of this functionality via the CellDataError event. The CellDataErrorEventArgs has RetainFocus and RevertValue (among other properties) that let you do the same thing as the new InvalidValueBehavior property. The InvalidValueBehavior property was added mainly to make it easier for the users to discover the functionality and also easily set it.