[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
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Collapse]Vertical Grid
   [Expand]Product Information
   [Expand]ASPxVerticalGrid Getting Started
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Collapse]Data Editing
      Batch Edit Mode
      Adding and Deleting Records
      Record Validation and Error Indication
      Processing Custom Callbacks
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
     Appearance Customization
    ASPxVerticalGrid Designer
   [Expand]Visual Elements
   [Expand]Member Tables
  [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]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Record Validation and Error Indication

This topic describes how to check the validity of data entered by end-users into a record. ASPxVerticalGrid allows you to manually validate an edited record, and display error icons for invalid fields.

Expanded Validating Records

To implement record validation, you should handle the ASPxVerticalGrid.RecordValidating event. This event is automatically raised when a record is about to be updated, and allows you to specify whether its data is valid or not.

  • The event's OldValues and NewValues properties allow old and new record values to be obtained, respectively. These properties represent collections. Individual record values can be obtained using index notation or by specifying field names. The event's IsNewRecord property identifies whether or not a new record is being edited by the user.

  • If the value is invalid, use the Errors property to specify the error description text. As a result, an error icon will be displayed next to the invalid value. Pointing to the icon shows a hint with an error description.

  • Use the RecordError property to specify the error text displayed within the Record Error. This record is automatically displayed below the edited record if the RecordError property is set to a non-empty string.

    Use the ASPxGridBehaviorSettings.EncodeErrorHtml option to specify whether or not ASPxVerticalGrid keeps its record errors that are HTML as HTML, or strips out the HTML markers instead.

Expanded Validating Edit Cells

Data rows provide various validation settings available by the EditProperties.ValidationSettings property. This allows you to define the validation logic for individual edit cells.

For example, you can use the ValidationSettings.RequiredField property to force an editor to require input, and specify an error message if input is not received.

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