Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Chart Control
  [Expand]Grid View
  [Collapse]Card View
   [Expand]Product Information
    [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
     Save and Restore Layout
     Export Overview
   [Expand]Visual Elements
   [Expand]Member Tables
  [Expand]Vertical Grid
  [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]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [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]Report Server
[Expand]eXpressApp Framework
[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

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