Skip to main content

RuleBaseAttribute.SkipNullOrEmptyValues Property

Specifies whether the current rule is checked for the properties that are set to null (Nothing in VB), an empty string (for string type propeties) or a minimal date (for DateTime type properties).

Namespace: DevExpress.Persistent.Validation

Assembly: DevExpress.Persistent.Base.v25.2.dll

NuGet Package: DevExpress.Persistent.Base

Declaration

public bool SkipNullOrEmptyValues { get; set; }

Property Value

Type Description
Boolean

true if null-like values are not checked by the current rule; otherwise, false.

Remarks

When defining a rule, you can specify whether to consider the properties that are set to null, an empty string (for string type propeties) or a minimal date (for DateTime type properties) when checking the rule. To set the required behavior for a rule that is defined via a validation attribute, use the named SkipNullOrEmptyValues parameter.

[RuleUniqueValue(DefaultContexts.Save, SkipNullOrEmptyValues = false)]
public string UniqueValue { 
   //...
}

By default, SkipNullOrEmptyValues is set to false in the RuleRequiredField rule; in the remaning validation rules, it is set to true.

The SkipNullOrEmptyValues behavior specified for a validation rule in code is set for the SkipNullOrEmptyValues property of the Application Model’s IModelRuleBase node. So, you can change this behavior directly in the Model Editor.

See Also