Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Collapse]Data Editors
   [Expand]Product Information
   [Collapse]Common Concepts
     Binding to Data
    [Expand]Mask Editing
    [Collapse]Validation
      Validation Overview
      Validation Settings
      Validation Error Message
      Validation Summary
     [Collapse]Examples
       How to: Validate a Particular Editor
       How to: Validate a Group of Editors
       How to: Validate All Editors on a Page
       How to: Implement a Custom Validation
       How to: Determine Editors Validity
    [Expand]List Editors
     Accessibility Support
   [Expand]Editor Types
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Determine Editors Validity

Expanded How to determine a single editor validity

  • To determine a single editor validity on the server side, use the ASPxEdit.IsValid property.
  • To determine a single editor validity on the client side, call the ASPxClientEdit.GetIsValid method. Note that the GetIsValid method does not perform validation, it only returns an editor's validation status.

     

    The code sample below demonstrates how you can perform a custom validation without using any predefined validation capabilities. Note that in this case, the ValidationSettings.EnableCustomValidation property should be set to true to show an error frame.

Expanded How to determine a validity of several editors

Note

The server-side Page.IsValid property (or the Page_IsValid on the client side) isn't affected by the DevExpress control's validation process.

You can use the AreEditorsValid, ValidateEditorsInContainer, ValidateEditorsInContainerById, or ValidateGroup method to determine the validity of several editors instead.

 

  • Use of the AreEditorsValid methods

    The ASPxEdit.AreEditorsValid and ASPxClientEdit.AreEditorsValid methods can be used to determine editor validity on the server and client side respectively. The methods check the validity (the ASPxEdit.IsValid property value) of several DevExpress editors without validating them again.

     

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1844.

    This example demonstrates how the AreEditosValid method can be used to check the validity of several DevExpress editors. In this sample, a click on the button automatically performs client and server validations of editors contained within the same container as the button.

    Since client validation is raised automatically via a button click, it's allowed to use the client ASPxClientEdit.AreEditorsValid method when handling the button's client ASPxButton.Click event. If client validation passes successfully, then server validation of editors is automatically performed while processing a postback. In this case, the server ASPxEdit.AreEditorsValid method can be used to check the error state of editors.

  •  

  • Use of the ValidateEditorsInContainer, ValidateEditorsInContainerById, and ValidateGroup methods

    Another solution is to use the ASPxEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainerById, or ASPxClientEdit.ValidateGroup method, which return a boolean value specifying editor validity. Note that the methods re-run the validation for each control even if a given control has already been validated.

     

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3633.

    This example demonstrates how to validate editors in a container on the server side. The ASPxEdit.ValidateEditorsInContainer method is used to determine the validity of editors within a callback panel.

How would you rate this topic?​​​​​​​