Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ValidationModule.InitializeRuleSet() Method

Initializes the RuleSet object assigned to the Validator.RuleSet property.

Namespace: DevExpress.ExpressApp.Validation

Assembly: DevExpress.ExpressApp.Validation.v21.2.dll

Declaration

public void InitializeRuleSet()

Remarks

The Validation Module calls this method on logon and when a user closes the Model Editor at runtime. To initialize validation rules before the main window is displayed and a user logs into the application, follow the steps below:

  1. Override the ModuleBase.Setup method in a platform-specific or platform-agnostic Module.
  2. In this overridden method, handle the XafApplication.SetupComplete event.
  3. In the event handler, access the Validation Module and call the InitializeRuleSet method.

File: MySolution.Module\Module.cs(.vb).

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Validation;
// ...
public sealed partial class MySolutionModule : ModuleBase {
    public override void Setup(XafApplication application) {
        base.Setup(application);
        application.SetupComplete += Application_SetupComplete;
    }
    private void Application_SetupComplete(object sender, EventArgs e) {
        ValidationModule module = (ValidationModule)Application.Modules.FindModule(typeof(ValidationModule));
        if(module != null) {
            module.InitializeRuleSet();
        }
    }
    // ...
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the InitializeRuleSet() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also