[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Collapse]Data Editing and Validation
     Data Editing Overview
     Edit Form
     New Item Row
    [Expand]Inplace Editors
    [Collapse]Input Validation
      Cell Validation
      Row Validation
      Error Notification
      Attributes-Based Validation
      Examples
    [Expand]Editing in Code
    [Expand]Clipboard Management
     Moving Nodes in TreeList
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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

Error Notification

If the GridControl is bound to DataView or DataTable, you can set errors for any cell within any row using methods provided by the data source. To set an error for the required cell, call the DataRow.SetColumnError method. The GridControl indicates these errors by displaying error icons () within cells with the descriptions displayed as tooltips.

To support error notifications for a custom data source (IList, ITypedList, IListSource, IBindingList, etc.), objects that represent records in a data source should implement the IDXDataErrorInfo or System.ComponentModel.IDataErrorInfo interface.

This document describes how to implement error notifications for a custom data source using IDXDataErrorInfo.

Expanded Implementing the Error Notifications for a Custom Data Source

When binding a grid to a custom data source (e.g. data created at runtime), you create two classes:

  • the class representing the data source. This class implements one of the interfaces (IList, IListSource, ITypedList, IBindingList), and provides access to the collection of records.
  • the class implementing a single record in a data source.

To support error notifications, the class encapsulating a single record must implement the IDXDataErrorInfo interface. This interface provides two methods, that when implemented, get errors for the entire row and for individual cells (data source fields). As a result, the grid automatically displays error icons within cells with invalid values. Pointing to such an error icon displays a tooltip with an error description.

  • IDXDataErrorInfo.GetPropertyError - When implemented by a class, returns information on an error associated with the specified property (data field) of a data object.
  • IDXDataErrorInfo.GetError - When implemented by a class, returns information on an error associated with a data object (row).

Refer to the How to: Validate Data Rows and Indicate Errors example to learn more how to use IDXDataErrorInfo.

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