[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
   Getting Started
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Collapse]Data Editing
      Edit Form
      Adding and Deleting Records
      Row Validation and Error Indication
      Edit Form Validation (Templates)
      Processing Custom Callbacks
      Batch Edit Mode
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
    [Expand]Master-Detail Relationship
     Appearance Customization
     Save and Restore Layout
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [Expand]Tree List
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [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]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]Report and Dashboard 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 via 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 GridViewTemplates.EditForm or GridViewDataColumn.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 ASPxGridView.RowValidating 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 (GridViewEditFormTemplateContainer.ValidationGroup or GridViewEditItemTemplateContainer.ValidationGroup). 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.



Regular form editors created by the ASPxGridViewTemplateReplacement control are automatically validated on the client if their validation settings are defined on the column level.

Expanded See Also

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