[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
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Collapse]Card View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Collapse]Data Editing
      Edit Form
      Adding and Deleting Cards
      Card Validation and Error Indication
      Edit Form Validation (Templates)
      Processing Custom Callbacks
      Batch Edit Mode
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
     Appearance Customization
     Adaptivity
     Save and Restore Layout
    [Expand]Templates
    [Expand]Export
     Toolbars
   [Expand]Visual Elements
   [Expand]Member Tables
   [Expand]Examples
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [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]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Edit Form Validation (Templates)

Data entered by an end-user within the Edit Form's editors can be validated on the client or server side before posting it to a data source. Client-side validation helps you improve performance, because it avoids sending a callback to a server.

Expanded Regular Edit Form

A click on the Update button within the regular Edit Form automatically invokes client validation for form editors whose validation settings are defined using the corresponding columns' EditProperties.ValidationSettings property (it can be accessed by a column's property providing access to editor settings, e.g., PropertiesTextEdit). In this instance, if the validation fails, error icons are displayed next to editors with invalid values.

Expanded Templated Edit Form

If you design the Edit Form yourself, you use either the CardViewTemplates.EditForm or CardViewColumn.EditItemTemplate template and add custom editors to the Edit Form's template container. In this instance, when pressing the standard Update button, client-side validation will not be automatically invoked for the custom editors and the 'UPDATEEDIT' callback will be sent to the server. In this situation, you should implement server-side validation by handling the ASPxCardView.CardValidating event. Otherwise, invalid data will be posted to a database.

To invoke client-side validation for custom editors placed within the Edit Form's template, make use of a template container's ValidationGroup property. You can assign this property value to the ValidationSettings.ValidationGroup property of custom editors to be validated. The code below demonstrates how this can be done when defining an Edit Form's template.

As a result, client validation will be performed after clicking the Update button, and the 'UPDATEEDIT' callback will not be sent to the server while the Edit Form contains invalid values.

 

Expanded See Also

Is this topic helpful?​​​​​​​