AlwaysValidate Property (Field)

Specifies whether to validate the editor's value even if the user doesn't modify the value. Default value is null which will resolve to False where the editor only validates the value if the user modifies it.
Public Property AlwaysValidate As Nullable(Of Boolean)
public Nullable<bool> AlwaysValidate {get; set;}

By default the editor validates the value only if the user has modified it, even if the editor's value is invalid. If the user doesn't modify the value and tries the leave the editor with invalid value that the editor was initialized with, no validation takes place. You can change this behavior by setting AlwaysValidate to true, where the editor will take validation action based on the InvalidValueBehavior property setting as long as the editor's value is invalid, regardless of whether the the user has modified it or not.

As an example, let's say ValueConstraint on the editor had MinLength constraint set to 5. The editor is initialized with string value "a", which doesn't meet the MinLength of 5 constraint. The editor's IsValueValid would be false, since the current value doesn't meet the value constraint. If the user tries to leave the editor without modifying the value, by default the editor will not take any validation action and prompt the user of invalid value. However if you set AlwaysValidate to true, the editor will take validation action. Note that if the user modifies the value, then the editor will validate regardless of this property setting.


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