Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ValidationService.HasValidationError Attached Property

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

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.2.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