バージョン

ComparisonOperatorFlags 列挙体

ComparisonOperator 列挙型の値をミラーする列挙型にフラグを付けます。これは、データ プレゼンターの FieldSettings の FilterOperatorDropDownItems などのプロパティを指定するのに使用されます。
シンタックス
'宣言
 
Public Enum ComparisonOperatorFlags 
   Inherits System.Enum
public enum ComparisonOperatorFlags : System.Enum 
メンバ
メンバ解説
Allすべての演算子。
BottomComparisonOperatorBottom に対応します。
BottomPercentileComparisonOperatorBottomPercentile に対応します。
ContainsComparisonOperatorContains に対応します。
DoesNotContainComparisonOperatorDoesNotContain に対応します。
DoesNotEndWithComparisonOperatorDoesNotEndWith に対応します。
DoesNotMatchComparisonOperatorDoesNotMatch に対応します。
DoesNotStartWithComparisonOperatorDoesNotStartWith に対応します。
EndsWithComparisonOperatorEndsWith に対応します。
EqualsComparisonOperatorEquals に対応します。
GreaterThanComparisonOperatorGreaterThan に対応します。
GreaterThanOrEqualsToComparisonOperatorGreaterThanOrEqualTo に対応します。
InComparisonOperatorIn に相対します。
LessThanComparisonOperatorLessThan に対応します。
LessThanOrEqualsToComparisonOperatorLessThanOrEqualTo に対応します。
LikeComparisonOperatorLike に対応します。
MatchComparisonOperatorMatch に対応します。
Noneなし。
NotEqualsComparisonOperatorNotEquals に対応します。
NotInComparisonOperatorNotIn に相対します。
NotLikeComparisonOperatorNotLike に対応します。
StartsWithComparisonOperatorStartsWith に対応します。
TopComparisonOperatorTop に対応します。
TopPercentileComparisonOperatorTopPercentile に対応します。
解説

ComparisonOperatorFlags は、フラグが付いていない ComparisonOperator 列挙型の値をミラーする値でフラグが付けられた列挙型です。これは、データ プレゼンターの FieldSettings の FilterOperatorDropDownItems などのプロパティを指定するのに使用されます。

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

    Private Sub Dp_FieldLayoutInitialized(ByVal sender As Object, ByVal e As FieldLayoutInitializedEventArgs)
        ' Enable the filter-record.
        e.FieldLayout.FieldSettings.AllowRecordFiltering = True

        ' FilterStringComparisonType controls whether to perform case-sensitive or 
        ' case-insensitive string comparisons for filtering purposes.
        e.FieldLayout.FieldSettings.FilterStringComparisonType = FieldSortComparisonType.CaseInsensitive

        ' The following for loop sets FilterOperatorDefaultValue, FilterOperatorDropDownItems
        ' and FilterOperandUIType properties on each field based on the field's data type.
        Dim field As Field
        For Each field In e.FieldLayout.Fields
            Dim dataType As Type = field.DataType

            If dataType Is GetType(String) Then
                ' For string fields, pre-select StartsWith operator.
                field.Settings.FilterOperatorDefaultValue = ComparisonOperator.StartsWith

                ' For operator drop-down, limit the available options to the following.
                field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals _
                          Or ComparisonOperatorFlags.StartsWith _
                          Or ComparisonOperatorFlags.Contains _
                          Or ComparisonOperatorFlags.Like

                ' For the operand input, use a text-box.
                e.FieldLayout.FieldSettings.FilterOperandUIType = FilterOperandUIType.TextBox
            ElseIf Utilities.IsNumericType(dataType) OrElse dataType Is GetType(DateTime) Then
                ' For numeric and date fields, pre-select Equals operator.
                field.Settings.FilterOperatorDefaultValue = ComparisonOperator.Equals

                ' For operator drop-down, limit the available options to the following.
                field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals _
                          Or ComparisonOperatorFlags.LessThan _
                          Or ComparisonOperatorFlags.LessThanOrEqualsTo _
                          Or ComparisonOperatorFlags.GreaterThan _
                          Or ComparisonOperatorFlags.GreaterThanOrEqualsTo

                ' For the operand input, use the same editor as rest of the cells in the field
                ' are using. By default numeric field cells use numeric editor and date field
                ' cells use date-time editor.
                e.FieldLayout.FieldSettings.FilterOperandUIType = FilterOperandUIType.UseFieldEditor
            ElseIf dataType Is GetType(Boolean) Then
                ' For boolean fields, set the default operator to Equals.
                field.Settings.FilterOperatorDefaultValue = ComparisonOperator.Equals

                ' Also just allow Equals operator. This will effectively hide the operator
                ' drop-down.
                field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals

                ' For the operand input, use drop-down list.
                field.Settings.FilterOperandUIType = FilterOperandUIType.DropDownList
            End If

        Next
    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_FieldLayoutInitialized( object sender, FieldLayoutInitializedEventArgs e )
		{
			// Enable the filter-record.
			e.FieldLayout.FieldSettings.AllowRecordFiltering = true;

			// FilterStringComparisonType controls whether to perform case-sensitive or 
			// case-insensitive string comparisons for filtering purposes.
			e.FieldLayout.FieldSettings.FilterStringComparisonType = FieldSortComparisonType.CaseInsensitive;

			// The following for loop sets FilterOperatorDefaultValue, FilterOperatorDropDownItems
			// and FilterOperandUIType properties on each field based on the field's data type.
			foreach ( Field field in e.FieldLayout.Fields )
			{
				Type dataType = field.DataType;

				if ( typeof( string ) == dataType )
				{
					// For string fields, pre-select StartsWith operator.
					field.Settings.FilterOperatorDefaultValue = ComparisonOperator.StartsWith;

					// For operator drop-down, limit the available options to the following.
					field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals
						| ComparisonOperatorFlags.StartsWith
						| ComparisonOperatorFlags.Contains
						| ComparisonOperatorFlags.Like;

					// For the operand input, use a text-box.
					e.FieldLayout.FieldSettings.FilterOperandUIType = FilterOperandUIType.TextBox;
				}
				else if ( Utilities.IsNumericType( dataType ) || typeof( DateTime ) == dataType )
				{
					// For numeric and date fields, pre-select Equals operator.
					field.Settings.FilterOperatorDefaultValue = ComparisonOperator.Equals;

					// For operator drop-down, limit the available options to the following.
					field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals
						| ComparisonOperatorFlags.LessThan
						| ComparisonOperatorFlags.LessThanOrEqualsTo
						| ComparisonOperatorFlags.GreaterThan
						| ComparisonOperatorFlags.GreaterThanOrEqualsTo;

					// For the operand input, use the same editor as rest of the cells in the field
					// are using. By default numeric field cells use numeric editor and date field
					// cells use date-time editor.
					e.FieldLayout.FieldSettings.FilterOperandUIType = FilterOperandUIType.UseFieldEditor;
				}
				else if ( typeof( bool ) == dataType )
				{
					// For boolean fields, set the default operator to Equals.
					field.Settings.FilterOperatorDefaultValue = ComparisonOperator.Equals;

					// Also just allow Equals operator. This will effectively hide the operator
					// drop-down.
					field.Settings.FilterOperatorDropDownItems = ComparisonOperatorFlags.Equals;

					// For the operand input, use drop-down list.
					field.Settings.FilterOperandUIType = FilterOperandUIType.DropDownList;
				}
			}
		}
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

            
<igDP:XamDataGrid.FieldSettings>
                
<!--Set AllowRecordFiltering to enable filter-record.-->
                
<igDP:FieldSettings AllowRecordFiltering="true" />
            
</igDP:XamDataGrid.FieldSettings>
            
            
<igDP:XamDataGrid.FieldLayouts>
                
<igDP:FieldLayout IsDefault="true">
                    
<igDP:FieldLayout.Fields>

                        
<!--For Country field, use settings appropriate for string data types.
                        * pre-select StartsWith operator by setting FilterOperatorDefaultValue
                        * limit operator drop-down items to Equals, StartsWith, Contains and Like
                        * Use TextBox for the operand input by setting FilterOperandUIType to TextBox
                        
-->
                        
<igDP:Field Name="Country">
                            
<igDP:Field.Settings>
                                
<igDP:FieldSettings
                                        
FilterOperatorDefaultValue="StartsWith"
                                        
FilterOperatorDropDownItems="Equals, StartsWith, Contains, Like"
                                        
FilterOperandUIType="TextBox"
                                    
/>                                        
                            
</igDP:Field.Settings>    
                        
</igDP:Field>

                        
<!--For Price field, use settings appropriate for numeric data types.
                        * pre-select Equals operator by setting FilterOperatorDefaultValue
                        * limit operator drop-down items to Equals, StartsWith, Contains and Like
                        * Use the same editor as the field cells by setting FilterOperandUIType to UseFieldEditor
                        
-->
                        
<igDP:Field Name="Price">
                            
<igDP:Field.Settings>
                                
<igDP:FieldSettings
                                        
FilterOperatorDefaultValue="Equals"
                                        
FilterOperatorDropDownItems="Equals, LessThan, LessThanOrEqualsTo, GreaterThan, GreaterThanOrEqualsTo"
                                        
FilterOperandUIType="UseFieldEditor"
                                    
/>
                            
</igDP:Field.Settings>
                        
</igDP:Field>

                        
<!--For IsChecked field, use settings appropriate for boolean data type.
                        * pre-select Equals operator by setting FilterOperatorDefaultValue
                        * Hide the operator drop-down by setting FilterOperatorDropDownItems to a single value
                        * Use drop-down list for the operand input by setting FilterOperandUIType to DropDownList
                        
-->
                        
<igDP:Field Name="IsChecked">
                            
<igDP:Field.Settings>
                                
<igDP:FieldSettings
                                        
FilterOperatorDefaultValue="Equals"
                                        
FilterOperatorDropDownItems="Equals"
                                        
FilterOperandUIType="DropDownList"
                                    
/>
                            
</igDP:Field.Settings>
                        
</igDP:Field>
                        
                    
</igDP:FieldLayout.Fields>
                
</igDP:FieldLayout>
            
</igDP:XamDataGrid.FieldLayouts>
            
        
</igDP:XamDataGrid>

参照