Skip to content

DevExpress-Examples/wpf-data-grid-validate-data-rows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Data Grid - How to Validate Data Rows

This example shows how to check if a user enters valid data into a row. Handle the ValidateRow and InvalidRowException events to validate the focused row's data. You can also use the ValidateRowCommand and InvalidRowExceptionCommand properties to maintain a clean MVVM pattern and process the row validate operation in a ViewModel. If the data is invalid, do not allow the user to move focus to another row until the invalid values are corrected.

The Task class implements the IDataErrorInfo interface and allows you to get error descriptions for the entire row and individual cells (data source fields). Error icons appear in cells that contain invalid values. Hover the mouse pointer over an error icon to display a tooltip with an error description.

Files to Look At

Code Behind Technique

MVVM Technique

Documentation

More Examples