Tab

ASPxGlobalEvents.ValidationCompleted Event

Occurs after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public 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
Container Gets a container object that holds the validated control(s).
FirstInvalidControl Gets the first control (either visible or invisible) that hasn't passed the validation applied.
FirstVisibleInvalidControl Gets the first visible control that hasn't passed the validation applied.
InvisibleControlsValidated Gets a value that indicates whether validation has been applied to both visible and invisible controls.
IsValid Gets a value specifying whether the validation has been completed successfully.
ValidationGroup Gets the name of the validation group to which validation has been applied.

Remarks

Each time validation initiated for a DevExpress web control or a group of DevExpress web controls is completed, the ValidationCompleted event is generated. This event fires after all ASPxEdit.Validation events of the validated DevExpress web controls.

A handler of the ValidationCompleted event is a suitable place to find out whether all DevExpress web controls have passed the validation (by analyzing the ValidationCompletedEventArgs.IsValid property). You can access the first control that failed the validation (by using the ValidationCompletedEventArgs.FirstInvalidControl or ValidationCompletedEventArgs.FirstVisibleInvalidControl property), obtain the container of the validated controls (ValidationCompletedEventArgs.Container) or the name of their validation group (ValidationCompletedEventArgs.ValidationGroup).

For instance, the ValidationCompleted event might be helpful if you validate editors located within different tab pages of the ASPxPageControl, and need to move input focus to an invalid editor within a non-active tab page.

Examples

The complete sample project is available in the DevExpress Code Central database at E942.

<script runat="server">
     protected void ASPxGlobalEvents1_ValidationCompleted(object sender, 
     DevExpress.Web.ValidationCompletedEventArgs e) {
     lErrorMessageNotEqual.ClientVisible = !tbPassword.Value.Equals(tbConfirmedPassword.Value);
     }
</script>
...
<dxge:ASPxGlobalEvents id="ASPxGlobalEvents1" runat="server" 
OnValidationCompleted="ASPxGlobalEvents1_ValidationCompleted">
    <ClientSideEvents ValidationCompleted="OnValidationCompleted" />
</dxge:ASPxGlobalEvents>
...
See Also