Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[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]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Collapse]Vertical Grid
   [Expand]Product Information
   [Expand]ASPxVerticalGrid Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [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
     Templates
     Export
     Toolbars
    ASPxVerticalGrid Designer
   [Expand]Visual Elements
  [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
  [Expand]Data Editors
  [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

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?​​​​​​​