Skip to main content
All docs
V24.1

ValidationService.HasValidationError Attached Property

Indicates whether validation has failed. This is an attached property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

Returns

Type Description
Boolean

true if validation has failed; otherwise, false.

Remarks

The ValidationService.HasValidationError attached property returns true for container controls that contain editors with validation errors. This property detects the following validation types (supported by DevExpress WPF Controls): validation interfaces, the Validate event, the ValidationService class, and ValidationRule descendants.

ValidationService - HasValidationError Example

<Border dxe:ValidationService.IsValidationContainer="True"
        BorderThickness="2" 
        BorderBrush="{Binding Path=(dxe:ValidationService.HasValidationError), 
                              Converter={dxmvvm:BooleanToObjectConverter TrueValue=Red, FalseValue=Black}, 
                              RelativeSource={RelativeSource Self}}">
    <dxe:TextEdit Validate="OnValidate"/>
</Border>

The ValidationErrors property returns a collection of validation errors.

See Also