Skip to main content
All docs
V25.1
  • .NET Framework 4.6.2+

    IRuleSet.ValidationCompleted Event

    Occurs after validation of an entire IRuleSet is complete.

    Namespace: DevExpress.Persistent.Validation

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

    Declaration

    event EventHandler<ValidationCompletedEventArgs> ValidationCompleted

    Event Data

    The ValidationCompleted event's data class is ValidationCompletedEventArgs. The following properties provide information specific to this event:

    Property Description
    Exception Specifies a validation exception that will be raised if the validation is unsuccessful.
    Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.
    ObjectSpace Returns an IObjectSpace used by the RuleSet.
    Result Returns the result of the entire RuleSet validation.
    SourceFrame The Frame of the Controller that validates objects. Only WinForms applications use this property.
    Successful Indicates if the validation was successful.

    Remarks

    Handle this event to change or remove the ValidationCompletedEventArgs.Exception.

    The following example demonstrates how to hide the ObjectHeaderFormat part of the validation message:

    using System;
    using DevExpress.ExpressApp;
    using DevExpress.Persistent.Validation;
    // ...
    namespace MySolution.Module.Controllers {
        public class CustomizeValidationMessageController : WindowController {
            public CustomizeValidationMessageController() {
                TargetWindowType = WindowType.Main;
            }
            protected override void OnActivated() {
                base.OnActivated();
                Validator.GetService(Application.ServiceProvider).ValidationCompleted += new EventHandler<ValidationCompletedEventArgs>(RuleSet_ValidationCompleted);
            }
            void RuleSet_ValidationCompleted(object sender, ValidationCompletedEventArgs e) {
                if (e.Exception != null) {
                    e.Exception.ObjectHeaderFormat = "";
                }
            }
            protected override void OnDeactivated() {
                base.OnDeactivated();
                Validator.GetService(Application.ServiceProvider).ValidationCompleted -= new EventHandler<ValidationCompletedEventArgs>(RuleSet_ValidationCompleted);
            }
        }
    }
    
    See Also