To implement row-level validation you could handle the EditEnding event on the DataRow class. Since the sender of this event is a DataRow object, you will have access to the entire row to provide the desired validation. For example:
<Style TargetType="{x:Type xcdg:DataRow}"> <EventSetter Event="EditEnding" Handler="EditEndingHandler"/> </Style> |
In code-behind:
private void EditEndingHandler( object sender, RoutedEventArgs e ) { Xceed.Wpf.DataGrid.DataRow row = sender as Xceed.Wpf.DataGrid.DataRow;
if( row != null ) { // do your validation here } } |