Xceed DataGrid for WPF v7.3 Documentation
Xceed.Wpf.DataGrid Assembly / Xceed.Wpf.DataGrid Namespace / DataGridBindingInfo Class
Members Example


    DataGridBindingInfo Class
    Class that creates and wraps a binding that is used by a column to retrieve and validate its values.
    Syntax
    'Declaration
     
    Public Class DataGridBindingInfo 
     
    'Usage
     
    Dim instance As DataGridBindingInfo
    Remarks

    The following table provides a list of the underlying binding's properties and their immutable values.

    Property Value
    Mode Property BindingMode.TwoWay (see ReadOnly property)
    UpdateSourceTrigger Property UpdateSourceTriggerExplicit (see UpdateSourceTrigger property)
    ValidatesOnDataErrors Property true
    ValidatesOnExceptions Property true
    NotifyOnTargetUpdated Property true
    NotifyOnValidationError Property true
    Example

    All examples in this topic assume that the grid is bound to a list of Composer objects, unless stated otherwise.

    The following example demonstrates how to create a custom ValidationRule and apply it to a column's binding to provide binding-level validation.Implementation of the YearValidationRule validation rule.Implementation of the YearValidationRule validation rule.
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
         xmlns:local="clr-namespace:Xceed.Wpf.Documentation">
      <Grid.Resources>
         <xcdg:DataGridCollectionViewSource x:Key="cvs_composers"
                                            Source="{Binding Source={x:Static Application.Current}, 
                                                             Path=Composers}"/>
      </Grid.Resources>
     
      <xcdg:DataGridControl ItemsSource="{Binding Source={StaticResource cvs_composers}}"
                            UpdateSourceTrigger="RowEndingEdit">
         <xcdg:DataGridControl.Columns> 
           <xcdg:Column FieldName="BirthYear">
              <xcdg:Column.DisplayMemberBindingInfo>
                 <xcdg:DataGridBindingInfo Path="BirthYear">
                    <xcdg:DataGridBindingInfo.ValidationRules>
                       <local:YearValidationRule />
                    </xcdg:DataGridBindingInfo.ValidationRules>
                 </xcdg:DataGridBindingInfo>
              </xcdg:Column.DisplayMemberBindingInfo>
           </xcdg:Column>
    
           <xcdg:Column FieldName="DeathYear">
              <xcdg:Column.DisplayMemberBindingInfo>
                 <xcdg:DataGridBindingInfo Path="DeathYear">
                    <xcdg:DataGridBindingInfo.ValidationRules>
                       <local:YearValidationRule />
                    </xcdg:DataGridBindingInfo.ValidationRules>
                 </xcdg:DataGridBindingInfo>
              </xcdg:Column.DisplayMemberBindingInfo>
           </xcdg:Column>      
        </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>
    </Grid>
    Inheritance Hierarchy

    System.Object
       Xceed.Wpf.DataGrid.DataGridBindingInfo

    Requirements

    See Also