バージョン

RecordFiltersLogicalOperator プロパティ

複数フィールドでフィルター条件を 「Or」 と 「And」 のどちらの論理演算子で結合するかを指定します。Default は「And」に解決されます。
シンタックス
'宣言
 
Public Property RecordFiltersLogicalOperator As Nullable(Of LogicalOperator)
public Nullable<LogicalOperator> RecordFiltersLogicalOperator {get; set;}
解説

RecordFiltersLogicalOperator プロパティは、複数フィールドに渡るレコード フィルターを組み合わせる方法を指定します。Or: 少なくても 1 つのフィールドのフィルターは条件を渡す場合は、レコードをフィルターします。And: すべてのフィールドのフィルターは条件を渡す場合は、レコードをフィルターします。レコードをフィルターするために、すべてのフィールドのフィルターが渡される必要があるデフォルトの And。

使用例
The following code sets RecordFiltersLogicalOperator to Or to have filter criteria accross fields or'ed instead of and'ed. It filters records so the records with Price of less than or equal to 0 OR Quantity of less than or equal to 0 are displayed.

Imports Infragistics.Windows
Imports Infragistics.Windows.Controls
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter
Imports Infragistics.Windows.DataPresenter.Events

    Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        
        Dim fieldLayout As FieldLayout = _dp.FieldLayouts(0)

        ' Create Price <= 0 filter.
        Dim priceFilter As RecordFilter = New RecordFilter()
        priceFilter.FieldName = "Price"
        priceFilter.Conditions.Add(New ComparisonCondition(ComparisonOperator.LessThanOrEqualTo, 0))

        ' Create Quantity <= 0 filter.
        Dim quantityFilter As RecordFilter = New RecordFilter()
        quantityFilter.FieldName = "Quantity"
        quantityFilter.Conditions.Add(New ComparisonCondition(ComparisonOperator.LessThanOrEqualTo, 0))

        ' Add both filters.
        fieldLayout.RecordFilters.Add(priceFilter)
        fieldLayout.RecordFilters.Add(quantityFilter)

        ' By default the filters are AND'ed across fields. That is a record must match 
        ' the filter criteria of all fields for it to be considered fitlered in. However
        ' in certain cases you may want to OR the filter criteria across fields. Here
        ' we want to display records where the Price <= 0 OR the Quantity <= 0. 
        ' Therefore set the RecordFiltersLogicalOperator to 'Or'.
        fieldLayout.Settings.RecordFiltersLogicalOperator = LogicalOperator.Or

    End Sub
using Infragistics.Windows;
using Infragistics.Windows.Controls;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;

public void Window1_Loaded( object sender, RoutedEventArgs e )
		{
			FieldLayout fieldLayout = _dp.FieldLayouts[0];

			// Create Price <= 0 filter.
			RecordFilter priceFilter = new RecordFilter( );
			priceFilter.FieldName = "Price";
			priceFilter.Conditions.Add( new ComparisonCondition( ComparisonOperator.LessThanOrEqualTo, 0 ) );

			// Create Quantity <= 0 filter.
			RecordFilter quantityFilter = new RecordFilter( );
			quantityFilter.FieldName = "Quantity";
			quantityFilter.Conditions.Add( new ComparisonCondition( ComparisonOperator.LessThanOrEqualTo, 0 ) );

			// Add both filters.
			fieldLayout.RecordFilters.Add( priceFilter );
			fieldLayout.RecordFilters.Add( quantityFilter );

			// By default the filters are AND'ed across fields. That is a record must match 
			// the filter criteria of all fields for it to be considered fitlered in. However
			// in certain cases you may want to OR the filter criteria across fields. Here
			// we want to display records where the Price <= 0 OR the Quantity <= 0. 
			// Therefore set the RecordFiltersLogicalOperator to 'Or'.
			fieldLayout.Settings.RecordFiltersLogicalOperator = LogicalOperator.Or;
		}
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >

            
<igDP:XamDataGrid.FieldLayouts>
                
                
<igDP:FieldLayout>
                    
<igDP:FieldLayout.Fields>
                        
<igDP:Field Name="ID" />
                        
<igDP:Field Name="Price" />
                        
<igDP:Field Name="Quantity" />                        
                    
</igDP:FieldLayout.Fields>

                    
<igDP:FieldLayout.Settings>
                        
<igDP:FieldLayoutSettings
                            
RecordFiltersLogicalOperator="Or"
                        
/>
                    
</igDP:FieldLayout.Settings>
                    
                    
<igDP:FieldLayout.RecordFilters>
                        
<igDP:RecordFilter FieldName="Price">
                            
<igWindows:ComparisonCondition Operator="LessThanOrEqualTo" Value="0" />
                        
</igDP:RecordFilter>
                        
<igDP:RecordFilter FieldName="Quantity">
                            
<igWindows:ComparisonCondition Operator="LessThanOrEqualTo" Value="0" />
                        
</igDP:RecordFilter>
                    
</igDP:FieldLayout.RecordFilters>
                    
                
</igDP:FieldLayout>
                
            
</igDP:XamDataGrid.FieldLayouts>
            
        
</igDP:XamDataGrid>
参照