Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]Controls and Libraries
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Collapse]API Reference
  [Expand]DevExpress.Charts.Designer
  [Expand]DevExpress.Mvvm.UI
  [Expand]DevExpress.Mvvm.UI.Interactivity
  [Expand]DevExpress.Mvvm.UI.ModuleInjection
  [Expand]DevExpress.Xpf.Accordion
  [Expand]DevExpress.Xpf.Bars
  [Expand]DevExpress.Xpf.Carousel
  [Expand]DevExpress.Xpf.Charts
  [Expand]DevExpress.Xpf.Charts.Localization
  [Expand]DevExpress.Xpf.Charts.RangeControlClient
  [Expand]DevExpress.Xpf.ChunkList
  [Expand]DevExpress.Xpf.Controls
  [Expand]DevExpress.Xpf.Core
  [Expand]DevExpress.Xpf.Core.ConditionalFormatting
  [Expand]DevExpress.Xpf.Core.DataSources
  [Expand]DevExpress.Xpf.Core.ServerMode
  [Expand]DevExpress.Xpf.Data
  [Expand]DevExpress.Xpf.DataAccess
  [Expand]DevExpress.Xpf.DataAccess.DataSourceWizard
  [Expand]DevExpress.Xpf.Diagram
  [Expand]DevExpress.Xpf.Docking
  [Expand]DevExpress.Xpf.Docking.Base
  [Expand]DevExpress.Xpf.DocumentViewer
  [Expand]DevExpress.Xpf.Editors
  [Expand]DevExpress.Xpf.Editors.DateNavigator
  [Expand]DevExpress.Xpf.Editors.ExpressionEditor
  [Expand]DevExpress.Xpf.Editors.Filtering
  [Expand]DevExpress.Xpf.Editors.Flyout
  [Expand]DevExpress.Xpf.Editors.Flyout.Native
  [Expand]DevExpress.Xpf.Editors.Helpers
  [Expand]DevExpress.Xpf.Editors.Popups
  [Expand]DevExpress.Xpf.Editors.RangeControl
  [Expand]DevExpress.Xpf.Editors.Settings
  [Expand]DevExpress.Xpf.Editors.Validation
  [Expand]DevExpress.Xpf.Gauges
  [Expand]DevExpress.Xpf.Gauges.Localization
  [Collapse]DevExpress.Xpf.Grid
    AutoFilterCondition Enumeration
    AutoGenerateColumnsMode Enumeration
   [Expand]BandBase Class
   [Expand]BaseColumn Class
   [Expand]BaseGridColumnHeader Class
    BestFitArea Enumeration
   [Expand]CardData Class
   [Expand]CardHeaderData Class
    CardLayout Enumeration
   [Expand]CardView Class
   [Expand]CardViewCommands Class
   [Expand]CardViewHitInfo Class
    CardViewHitTest Enumeration
    CardViewSelectMode Enumeration
   [Expand]CellContentPresenter Class
   [Expand]CellMergeEventArgs Class
   [Expand]CellValueChangedEventArgs Class
    CellValueChangedEventHandler Delegate
   [Expand]CellValueEventArgs Class
    CellValueEventHandler Delegate
    ClipboardCopyMode Enumeration
    ClipboardCopyOptions Enumeration
    ClipboardMode Enumeration
   [Expand]ColorScaleFormatCondition Class
   [Expand]ColumnBase Class
   [Expand]ColumnChooserControl Class
   [Expand]ColumnDataEventArgsBase Class
    ColumnFilterMode Enumeration
    ColumnFilterPopupMode Enumeration
    ColumnPosition Enumeration
   [Expand]ContentDetailDescriptor Class
   [Expand]CopyingToClipboardEventArgs Class
   [Expand]CopyingToClipboardEventArgsBase Class
    CopyingToClipboardEventHandler Delegate
   [Expand]CustomBestFitEventArgs Class
   [Expand]CustomBestFitEventArgsBase Class
    CustomBestFitEventHandler Delegate
   [Expand]CustomCellAppearanceEventArgs Class
   [Expand]CustomColumnDisplayTextEventArgs Class
    CustomColumnDisplayTextEventHandler Delegate
   [Expand]CustomColumnSortEventArgs Class
    CustomColumnSortEventHandler Delegate
   [Expand]CustomDataUpdateFormatConditionEventArgs Class
   [Expand]CustomFilterDisplayTextEventArgs Class
    CustomFilterDisplayTextEventHandler Delegate
   [Expand]CustomGroupDisplayTextEventArgs Class
    CustomGroupDisplayTextEventHandler Delegate
   [Expand]CustomRowAppearanceEventArgs Class
   [Expand]DataBarFormatCondition Class
   [Expand]DataControlBase Class
   [Expand]DataControlDetailDescriptor Class
   [Expand]DataControlSerializationOptions Class
   [Expand]DataUpdateFormatCondition Class
   [Expand]DataViewBase Class
   [Expand]DataViewCommandsBase Class
   [Expand]DefaultColumnMenuItemNames Class
   [Expand]DefaultSummaryMenuItemNames Class
   [Expand]DetailDescriptorBase Class
   [Expand]DetailDescriptorCollection Class
    EditFormPostMode Enumeration
   [Expand]EditFormShowingEventArgs Class
    EditFormShowMode Enumeration
   [Expand]EditGridCellData Class
    EditorButtonShowMode Enumeration
   [Expand]EditorEventArgs Class
   [Expand]EditorEventArgsBase Class
    EditorEventHandler Delegate
    ErrorsWatchMode Enumeration
   [Expand]ExcelColumnFilterSettings Class
    ExceptionMode Enumeration
   [Expand]ExpressionConditionBase Class
   [Expand]FilterEditorEventArgs Class
    FilterEditorEventHandler Delegate
   [Expand]FilterPopupEventArgs Class
    FilterPopupEventHandler Delegate
    FilterPopupMode Enumeration
    FixedRowPosition Enumeration
    FixedStyle Enumeration
   [Expand]FocusedRowChangedEventArgs Class
    FocusedRowChangedEventHandler Delegate
   [Expand]FormatCondition Class
   [Expand]FormatConditionBase Class
   [Expand]FormatConditionCollection Class
   [Expand]GridBandMenuInfo Class
   [Expand]GridCell Class
   [Expand]GridCellData Class
   [Expand]GridCellValidationEventArgs Class
    GridCellValidationEventHandler Delegate
   [Expand]GridColumn Class
   [Expand]GridColumnCollection Class
   [Expand]GridColumnCommands Class
   [Expand]GridColumnData Class
   [Expand]GridColumnDataEventArgs Class
    GridColumnDataEventHandler Delegate
   [Expand]GridColumnHeader Class
   [Expand]GridColumnHeaderBase Class
   [Expand]GridColumnWidth Structure
   [Expand]GridCommands Class
   [Expand]GridControl Class
   [Expand]GridControlBand Class
   [Expand]GridControlBandsLayout Class
   [Expand]GridControlLocalizer Class
    GridControlRuntimeStringId Enumeration
    GridControlStringId Enumeration
   [Expand]GridDataBase Class
   [Expand]GridDataViewBase Class
   [Expand]GridGroupSummaryData Class
   [Expand]GridGroupSummarySortInfo Class
   [Expand]GridGroupSummarySortInfoCollection Class
   [Expand]GridMenuEventArgs Class
    GridMenuEventHandler Delegate
   [Expand]GridMenuInfo Class
    GridMenuType Enumeration
   [Expand]GridPopupMenu Class
   [Expand]GridRowContent Class
   [Expand]GridRowValidationEventArgs Class
    GridRowValidationEventHandler Delegate
   [Expand]GridSelectionChangedEventArgs Class
    GridSelectionChangedEventHandler Delegate
   [Expand]GridSerializationOptions Class
   [Expand]GridSortInfo Class
   [Expand]GridSortInfoCollection Class
   [Expand]GridSummaryData Class
   [Expand]GridSummaryItem Class
    GridSummaryItemAlignment Enumeration
   [Expand]GridSummaryItemCollection Class
   [Expand]GridTotalSummaryData Class
   [Collapse]GridViewBase Class
     GridViewBase Members
    [Expand]GridViewBase Properties
    [Collapse]GridViewBase Events
      CellValueChanged Event
      CellValueChanging Event
      CopyingToClipboard Event
      HiddenEditor Event
      InvalidRowException Event
      RowCanceled Event
      RowUpdated Event
      SelectionChanged Event
      ShowingEditor Event
      ShownEditor Event
      ValidateCell Event
      ValidateRow Event
    [Expand]GridViewBase Methods
   [Expand]GridViewCommandsBase Class
   [Expand]GridViewHitInfoBase Class
    GridViewNavigationStyle Enumeration
   [Expand]GroupRowData Class
    GroupSummaryDisplayMode Enumeration
    HeaderPresenterType Enumeration
   [Expand]HeadersData Class
   [Expand]IconSetFormatCondition Class
    IncrementalSearchMode Enumeration
   [Expand]IndicatorFormatConditionBase Class
    IndicatorState Enumeration
   [Expand]InitNewRowEventArgs Class
    InitNewRowEventHandler Delegate
   [Expand]InvalidRowExceptionEventArgs Class
    InvalidRowExceptionEventHandler Delegate
   [Expand]LightweightCellEditor Class
   [Expand]LightweightCellEditorBase Class
    MergedGroupingMode Enumeration
    MergeGroupPosition Enumeration
   [Expand]MultiDetailDescriptor Class
    MultiSelectMode Enumeration
    NewItemRowPosition Enumeration
    PostConfirmationMode Enumeration
   [Expand]RowAllowEventArgs Class
    RowAllowEventHandler Delegate
    RowAnimationKind Enumeration
   [Expand]RowControl Class
   [Expand]RowData Class
   [Expand]RowDataBase Class
    RowDetailsVisibilityMode Enumeration
   [Expand]RowDoubleClickEventArgs Class
    RowDoubleClickEventHandler Delegate
   [Expand]RowEventArgs Class
    RowEventHandler Delegate
    RowFixingPosition Enumeration
    RowPosition Enumeration
    ScrollAnimationMode Enumeration
    ScrollBarAnnotationAlignment Enumeration
   [Expand]ScrollBarAnnotationInfo Class
    ScrollBarAnnotationMode Enumeration
   [Expand]ScrollBarAnnotationRowInfo Class
   [Expand]ScrollBarAnnotationsAppearance Class
   [Expand]ScrollBarAnnotationsCreatingEventArgs Class
   [Expand]ScrollBarCustomRowAnnotationEventArgs Class
    ScrollingMode Enumeration
    ScrollMode Enumeration
   [Expand]SelectedRowsCollection Class
    SelectionState Enumeration
    ShowFilterPanelMode Enumeration
    ShowFixRowButton Enumeration
   [Expand]ShowingEditorEventArgs Class
   [Expand]ShowingEditorEventArgsBase Class
    ShowingEditorEventHandler Delegate
    ShowSearchPanelMode Enumeration
   [Expand]SummaryItemBase Class
   [Expand]TableView Class
   [Expand]TableViewCommands Class
   [Expand]TableViewHitInfo Class
    TableViewHitTest Enumeration
    TableViewSelectMode Enumeration
   [Expand]TabViewDetailDescriptor Class
   [Expand]TopBottomRuleFormatCondition Class
    TreeDerivationMode Enumeration
   [Expand]TreeListBandMenuInfo Class
   [Expand]TreeListColumn Class
   [Expand]TreeListColumnCollection Class
   [Expand]TreeListControl Class
   [Expand]TreeListControlBand Class
   [Expand]TreeListControlBandsLayout Class
    TreeListFilterMode Enumeration
    TreeListLineStyle Enumeration
   [Expand]TreeListNode Class
   [Expand]TreeListNodeCollection Class
   [Expand]TreeListNodeIterator Class
   [Expand]TreeListNodeSummaryItemCollection Class
   [Expand]TreeListSortInfoCollection Class
   [Expand]TreeListSummaryItem Class
   [Expand]TreeListSummaryItemCollection Class
   [Expand]TreeListView Class
   [Expand]TreeListViewCommands Class
   [Expand]UnboundExpressionEditorEventArgs Class
    UnboundExpressionEditorEventHandler Delegate
   [Expand]UniqueDuplicateRuleFormatCondition Class
    UseCardLightweightTemplates Enumeration
    UseLightweightTemplates Enumeration
    WaitIndicatorType Enumeration
  [Expand]DevExpress.Xpf.Grid.ConditionalFormatting
  [Expand]DevExpress.Xpf.Grid.LookUp
  [Expand]DevExpress.Xpf.Grid.TreeList
  [Expand]DevExpress.Xpf.Layout.Core
  [Expand]DevExpress.Xpf.LayoutControl
  [Expand]DevExpress.Xpf.Map
  [Expand]DevExpress.Xpf.NavBar
  [Expand]DevExpress.Xpf.Navigation
  [Expand]DevExpress.Xpf.PdfViewer
  [Expand]DevExpress.Xpf.PivotGrid
  [Expand]DevExpress.Xpf.PivotGrid.Printing
  [Expand]DevExpress.Xpf.Printing
  [Expand]DevExpress.Xpf.Printing.Parameters
  [Expand]DevExpress.Xpf.Printing.Parameters.Models
  [Expand]DevExpress.Xpf.Printing.PreviewControl.Bars
  [Expand]DevExpress.Xpf.Prism
  [Expand]DevExpress.Xpf.PropertyGrid
  [Expand]DevExpress.Xpf.Reports.UserDesigner
  [Expand]DevExpress.Xpf.Reports.UserDesigner.Extensions
  [Expand]DevExpress.Xpf.Reports.UserDesigner.Localization
  [Expand]DevExpress.Xpf.Reports.UserDesigner.ReportWizard
  [Expand]DevExpress.Xpf.Reports.UserDesigner.ReportWizard.Pages
  [Expand]DevExpress.Xpf.Ribbon
  [Expand]DevExpress.Xpf.RichEdit
  [Expand]DevExpress.Xpf.Scheduler
  [Expand]DevExpress.Xpf.Scheduler.Drawing
  [Expand]DevExpress.Xpf.Scheduler.Menu
  [Expand]DevExpress.Xpf.Scheduler.Reporting
  [Expand]DevExpress.Xpf.Scheduler.UI
  [Expand]DevExpress.Xpf.SpellChecker
  [Expand]DevExpress.Xpf.Spreadsheet
  [Expand]DevExpress.Xpf.Spreadsheet.Menu
  [Expand]DevExpress.Xpf.TreeMap
  [Expand]DevExpress.Xpf.Utils.Themes
  [Expand]DevExpress.Xpf.WindowsUI
  [Expand]DevExpress.Xpf.WindowsUI.Navigation
  [Expand]DevExpress.XtraRichEdit
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

GridViewBase.ValidateRow Event

Enables you to specify whether the focused row's data is valid, and whether the row can lose focus.

Namespace:DevExpress.Xpf.Grid
Assembly:DevExpress.Xpf.Grid.v17.1.dll

Expanded Syntax

Expanded Event Data

The event handler receives an argument of type GridRowValidationEventArgs containing data related to this event.

The following GridRowValidationEventArgs properties provide information specific to this event.
Property Description
Culture Gets the culture related to the validation.
ErrorContent Gets or sets an object that describes the validation error.
ErrorType Gets or sets the error type.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
IsValid Gets or sets a value specifying whether the value is valid.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
RoutedEvent Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
Row Gets the processed row.
RowHandle Gets the processed row's handle.
Source Gets or sets a reference to the object that raised the event.
UpdateSource Gets the action that caused the validation.
Value Gets the editor's value.

Expanded Remarks

Row validation is performed within the ValidateRow event handler. This event is automatically fired after the focused row's data has been modified and it is about to lose focus. To manually force row validation, call the DataViewBase.CommitEditing method.

The processed row is returned by the event parameter's GridRowValidationEventArgs.Row property. Its handle is returned by the GridRowValidationEventArgs.RowHandle. After cell values have been obtained, you can verify whether these values meet your validity criteria. If the row fails validation, set the event's IsValid parameter to false. Otherwise, leave the IsValid parameter set to true.

To learn more, see Validating Rows.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1593.

This example shows how to check the validity of data entered by end-users into a data row. The ValidateRow and InvalidRowException events are handled to validate the focused row's data, and if it is invalid, prevent the row focus from being moved to another row until invalid values are corrected.

Since the Task class doesn't support error notifications, it implements the IDXDataErrorInfo interface, providing two members to get error descriptions for the entire row and for individual cells (data source fields). This displays error icons within cells with invalid values. Pointing to such an error icon displays a tooltip with an error description.

Expanded See Also

How would you rate this topic?​​​​​​​