バージョン

RecordFilterChanging イベント

ユーザーがレコード フィルター条件を変更するときに発生されます。
シンタックス
'宣言
 
Public Event RecordFilterChanging As EventHandler(Of RecordFilterChangingEventArgs)
public event EventHandler<RecordFilterChangingEventArgs> RecordFilterChanging
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、RecordFilterChangingEventArgs 型の引数を受け取りました。次の RecordFilterChangingEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Cancel Infragistics.Windows.Controls.Events.CancelableRoutedEventArgsから継承されます。 
Handled System.Windows.RoutedEventArgsから継承されます。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
NewRecordFilter 変更されたレコード フィルターを返します。
OriginalSource System.Windows.RoutedEventArgsから継承されます。Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
RoutedEvent System.Windows.RoutedEventArgsから継承されます。Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
Source System.Windows.RoutedEventArgsから継承されます。Gets or sets a reference to the object that raised the event.
解説

RecordFilterChanging は、ユーザー新しいレコード フィルタリング条件を入れた時、存在の条件を変更した時に発生します。このイベントは、変更された条件が適用される前に発生されます。

このイベントをキャンセルすることができます。キャンセルするとフィルター条件のユーザー変更が破棄されます。フィルター条件は、元のフィルター条件に戻されます。

使用例
Imports Infragistics.Windows
Imports Infragistics.Windows.Controls
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter
Imports Infragistics.Windows.DataPresenter.Events

    Private Sub Dp_RecordFilterChanging(ByVal sender As Object, ByVal e As RecordFilterChangingEventArgs)
        ' NewRecordFilter property returns the new filter criteria for the field.
        Dim newFilter As RecordFilter = e.NewRecordFilter
        Dim field As Field = newFilter.Field

        ' Print out the new filter conditions.
        If newFilter.Conditions.Count > 0 Then
            Debug.WriteLine("Record filter of " + field.Name + " field is being changed to " + newFilter.Conditions.ToolTip.ToString())
        Else
            Debug.WriteLine("Record filter of " & field.Name & " field is being cleared.")
        End If

        ' You can cancel the the change by seeting Cancel property.
        'e.Cancel = true;
    End Sub

    Private Sub Dp_RecordFilterChanged(ByVal sender As Object, ByVal e As RecordFilterChangedEventArgs)
        ' RecordFilter property returns the new filter criteria for the field.
        Dim newFilter As RecordFilter = e.RecordFilter
        Dim field As Field = newFilter.Field

        ' Print out the new filter conditions.
        If newFilter.Conditions.Count > 0 Then
            Debug.WriteLine("Record filter of " + field.Name + " field has been changed to " + newFilter.Conditions.ToolTip.ToString())
        Else
            Debug.WriteLine("Record filter of " & field.Name & " field has been cleared.")
        End If
    End Sub
using Infragistics.Windows;
using Infragistics.Windows.Controls;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;

		private void dp_RecordFilterChanging( object sender, RecordFilterChangingEventArgs e )
		{
			// NewRecordFilter property returns the new filter criteria for the field.
			RecordFilter newFilter = e.NewRecordFilter;
			Field field = newFilter.Field;

			// Print out the new filter conditions.
			if ( newFilter.Conditions.Count > 0 )
				Debug.WriteLine( "Record filter of " + field.Name + " field is being changed to " + newFilter.Conditions.ToolTip.ToString( ) );
			else
				Debug.WriteLine( "Record filter of " + field.Name + " field is being cleared." );

			// You can cancel the the change by seeting Cancel property.
			//e.Cancel = true;
		}

		private void dp_RecordFilterChanged( object sender, RecordFilterChangedEventArgs e )
		{
			// RecordFilter property returns the new filter criteria for the field.
			RecordFilter newFilter = e.RecordFilter;
			Field field = newFilter.Field;

			// Print out the new filter conditions.
			if ( newFilter.Conditions.Count > 0 )
				Debug.WriteLine( "Record filter of " + field.Name + " field has been changed to " + newFilter.Conditions.ToolTip.ToString( ) );
			else
				Debug.WriteLine( "Record filter of " + field.Name + " field has been cleared." );
		}
The following XAML code hooks into RecordFilterChanging and RecordFilterChanged events and enables the record filtering functionality.
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                            
RecordFilterChanging="dp_RecordFilterChanging"
                                            
RecordFilterChanged="dp_RecordFilterChanged"
                                        
>

            
<igDP:XamDataGrid.FieldSettings>
                
<!--Set AllowRecordFiltering to enable filter-record.-->
                
<igDP:FieldSettings AllowRecordFiltering="true" />
            
</igDP:XamDataGrid.FieldSettings>
            
        
</igDP:XamDataGrid>
参照