Welcome to the Xceed Community | Help
Community Search  
More Search Options

How to do row-level validation.

Sort Posts: Previous Next
  •  02-10-2009, 10:31 AM Post no. 28204

    How to do row-level validation.

    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
       }
    }

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.