バージョン

ComparisonOperator 列挙体

比較演算子を示す列挙体。
シンタックス
'宣言
 
Public Enum ComparisonOperator 
   Inherits System.Enum
public enum ComparisonOperator : System.Enum 
メンバ
メンバ解説
Bottomオペランドで指定された 'X' が、値の下位 'X' かどうかをテストします。
BottomPercentileオペランドで指定された 'X' が、値の下位 'X' パーセントかどうかをテストします。
Contains条件値が比較値を含むかどうかをテストします。
DoesNotContainContains の逆。
DoesNotEndWithEndsWith の逆。
DoesNotMatchMatchの逆。
DoesNotStartWithStartsWith の逆。
EndsWith値が比較値で終わるかどうかをテストします。
Equals2つの値が等しいかどうかをテストします。
GreaterThan値が比較値より大きいかどうかをテストします。
GreaterThanOrEqualTo値が比較値より大きいか、または等しいかどうかをテストします。
In値が指定した値かどうかを確認します。
LessThan値が比較値より小さいかどうかをテストします。
LessThanOrEqualTo値が比較値より小さいか、または等しいかどうかをテストします。
Like比較値(ワイルドカードを含む文字列)に対して値のワイルドカード比較を実行します。
Match比較値 (正規表現を含む) に対して値の正規表現比較を実行します。
NotEquals2 つの値が等しいかどうかをテストします。
NotIn値が指定した値ではないかどうかを確認します。
NotLikeLike の逆。
StartsWith値が比較値で始まるかどうかをテストします。
Topオペランドで指定された 'X' が、値の上位 'X' かどうかをテストします。
TopPercentileオペランドで指定された 'X' が、値の上位 'X' パーセントかどうかをテストします。
解説
ComparisonCondition の ComparisonCondition.Operator プロパティの指定に使用します。
使用例
Imports Infragistics.Windows
Imports Infragistics.Windows.Controls
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter

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

        ' Create a new RecordFilter for 'Country' field.
        Dim filter As RecordFilter = New RecordFilter()
        filter.FieldName = "Country"
        filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.Equals, "US"))

        ' Add the RecordFilter to field layout's RecordFilters collection.
        fieldLayout.RecordFilters.Add(filter)

        ' If you have hierarchical data source then you can also filter child records.
        ' Create a RecordFilter that filters the child records.
        filter = New RecordFilter()
        filter.FieldName = "Product"
        filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.Equals, "A"))

        ' Now add the filter. For child field layouts, each individual parent
        ' record's child records can be filtered independently. That is one parent
        ' record's child records can have different filter criteria from another
        ' parent record's child records. This is the default mode of filtering. You
        ' can change it by setting RecordFilterScope property to AllRecords in which
        ' case all child records in the child field layout are affected by the
        ' filter. However depending on the mode, the place where you specify the
        ' filter criteria is different. For the default SiblingDataRecords mode, you
        ' need to specify the filter criteria on RecordFilters property of the child
        ' RecordManager of a parent record. For the AllRecords mode, use the child
        ' FieldLayout's RecordFilters property. Note that the root field layout
        ' doesn't support SiblingDataRecords mode since it doesn't have multiple
        ' record collections and therefore for the root field layout, always use the
        ' field layout's RecordFilters property.
        ' 
        Dim childDataRecordsManager As RecordManager = _dp.RecordManager.Unsorted(0).ChildRecords(0).ChildRecordManager
        Dim childFieldLayout As FieldLayout = _dp.FieldLayouts(1)
        childFieldLayout.Settings.RecordFilterScope = RecordFilterScope.AllRecords
        If RecordFilterScope.AllRecords = childFieldLayout.Settings.RecordFilterScope Then
            ' When using AllRecords mode, use the field layout's RecordFilters.
            childFieldLayout.RecordFilters.Add(filter)
        Else
            ' When using SiblingDataRecords, use the child RecordManager's RecordFilters.
            childDataRecordsManager.RecordFilters.Add(filter)
        End If

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

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

			// Create a new RecordFilter for 'Country' field.
			RecordFilter filter = new RecordFilter( );
			filter.FieldName = "Country";
			filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.Equals, "US" ) );

			// Add the RecordFilter to field layout's RecordFilters collection.
			fieldLayout.RecordFilters.Add( filter );

			// If you have hierarchical data source then you can also filter child records.
			// Create a RecordFilter that filters the child records.
			filter = new RecordFilter( );
			filter.FieldName = "Product";
			filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.Equals, "A" ) );

			// Now add the filter. For child field layouts, each individual parent
			// record's child records can be filtered independently. That is one parent
			// record's child records can have different filter criteria from another
			// parent record's child records. This is the default mode of filtering. You
			// can change it by setting RecordFilterScope property to AllRecords in which
			// case all child records in the child field layout are affected by the
			// filter. However depending on the mode, the place where you specify the
			// filter criteria is different. For the default SiblingDataRecords mode, you
			// need to specify the filter criteria on RecordFilters property of the child
			// RecordManager of a parent record. For the AllRecords mode, use the child
			// FieldLayout's RecordFilters property. Note that the root field layout
			// doesn't support SiblingDataRecords mode since it doesn't have multiple
			// record collections and therefore for the root field layout, always use the
			// field layout's RecordFilters property.
			// 
			RecordManager childDataRecordsManager = _dp.RecordManager.Unsorted[0].ChildRecords[0].ChildRecordManager; 
			FieldLayout childFieldLayout = _dp.FieldLayouts[1];
			childFieldLayout.Settings.RecordFilterScope = RecordFilterScope.AllRecords;
			if ( RecordFilterScope.AllRecords == childFieldLayout.Settings.RecordFilterScope )
			{
				// When using AllRecords mode, use the field layout's RecordFilters.
				childFieldLayout.RecordFilters.Add( filter );
			}
			else
			{
				// When using SiblingDataRecords, use the child RecordManager's RecordFilters.
				childDataRecordsManager.RecordFilters.Add( filter );
			}
		}
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >

            
<igDP:XamDataGrid.FieldLayouts>
                
                
<!--Set filter on root field layout-->
                
<igDP:FieldLayout IsDefault="true">
                    
<igDP:FieldLayout.Fields>
                        
<igDP:Field Name="ID" />
                        
<igDP:Field Name="Country" />
                    
</igDP:FieldLayout.Fields>
                    
                    
<!--Set filter where records with Country=US will be displayed-->
                    
<igDP:FieldLayout.RecordFilters>
                        
<igDP:RecordFilter FieldName="Country">
                            
<igWindows:ComparisonCondition Operator="Equals" Value="US" />
                        
</igDP:RecordFilter>
                    
</igDP:FieldLayout.RecordFilters>
                    
                
</igDP:FieldLayout>

                
<!--Set filter on a child field layout. Only applicable if you have hierarchical data source.-->
                
<igDP:FieldLayout>
                    
<igDP:FieldLayout.Fields>
                        
<igDP:Field Name="ID" />
                        
<igDP:Field Name="Product" />
                    
</igDP:FieldLayout.Fields>

                    
<!--For child field layouts, you need to set the RecordFilterScope to AllRecords in order to
                    specify filters on the FieldLayout's RecordFilters.
-->
                    
<igDP:FieldLayout.Settings>
                        
<igDP:FieldLayoutSettings RecordFilterScope="AllRecords" />
                    
</igDP:FieldLayout.Settings>

                    
<!--Set filter where records with Product that starts with 'A' will be displayed.-->
                    
<igDP:FieldLayout.RecordFilters>
                        
<igDP:RecordFilter FieldName="Product">
                            
<igWindows:ComparisonCondition Operator="StartsWith" Value="A" />
                        
</igDP:RecordFilter>
                    
</igDP:FieldLayout.RecordFilters>

                
</igDP:FieldLayout>
                
            
</igDP:XamDataGrid.FieldLayouts>
            
        
</igDP:XamDataGrid>
参照