Infragistics(R) NetAdvantage(R) Windows Forms
FilterOperatorDefaultValue Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridOverride Class : FilterOperatorDefaultValue Property

Specifies the default (initial) value of the operator cells in the filter row. If operator cells are hidden, this is used as the filter operator for values entered in the associated filter operand cells. This can be overridden on each column. Default is resolved to Equals for DateTime and Boolean columns and StartsWith for other column types.

Syntax

Visual Basic (Declaration) 
Public Property FilterOperatorDefaultValue As FilterOperatorDefaultValue
C# 
public FilterOperatorDefaultValue FilterOperatorDefaultValue {get; set;}

Example

Following code shows some of the properties available to control the behavior related aspects of the Filter Row functionality.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Enable the the filter row user interface by setting the FilterUIType to FilterRow.
        e.Layout.Override.FilterUIType = FilterUIType.FilterRow

        ' FilterEvaluationTrigger specifies when UltraGrid applies the filter criteria typed 
        ' into a filter row. Default is OnCellValueChange which will cause the UltraGrid to
        ' re-filter the data as soon as the user modifies the value of a filter cell. This
        ' property is exposed off the the column as well so it can be set on a per column basis.
        e.Layout.Override.FilterEvaluationTrigger = FilterEvaluationTrigger.OnCellValueChange
        e.Layout.Bands(0).Columns(0).FilterEvaluationTrigger = FilterEvaluationTrigger.OnEnterKeyOrLeaveCell

        ' By default the UltraGrid selects the type of the filter operand editor based on
        ' the column's DataType. For DateTime and boolean columns it uses the column's editors.
        ' For other column types it uses the Combo. You can explicitly specify the operand
        ' editor style by setting the FilterOperandStyle on the override or the individual
        ' columns. This property is exposed on the column as well.
        e.Layout.Override.FilterOperandStyle = FilterOperandStyle.Combo
        e.Layout.Bands(0).Columns(0).FilterOperandStyle = FilterOperandStyle.DropDownList

        ' By default UltraGrid displays user interface for selecting the filter operator. 
        ' You can set the FilterOperatorLocation to hide this user interface. This
        ' property is available on column as well so it can be controlled on a per column
        ' basis. Default is WithOperand. This property is exposed off the column as well.
        e.Layout.Override.FilterOperatorLocation = FilterOperatorLocation.WithOperand
        e.Layout.Bands(0).Columns(0).FilterOperatorLocation = FilterOperatorLocation.Hidden

        ' By default the UltraGrid uses StartsWith as the filter operator. You use
        ' the FilterOperatorDefaultValue property to specify a different filter operator
        ' to use. This is the default or the initial filter operator value of the cells
        ' in filter row. If filter operator user interface is enabled (FilterOperatorLocation
        ' is not set to Hidden) then that ui will be initialized to the value of this
        ' property. The user can then change the operator via the operator ui. This
        ' property is exposed off the column as well.
        e.Layout.Override.FilterOperatorDefaultValue = FilterOperatorDefaultValue.StartsWith
        e.Layout.Bands(0).Columns(0).FilterOperatorDefaultValue = FilterOperatorDefaultValue.Equals

        ' FilterOperatorDropDownItems property can be used to control the options provided
        ' to the user for selecting the filter operator. By default UltraGrid bases 
        ' what operator options to provide on the column's data type. This property is
        ' avaibale on the column as well. Note that FilterOperatorDropDownItems is a flagged
        ' enum and thus multiple options can be combined using bitwise or operation.
        e.Layout.Override.FilterOperatorDropDownItems = FilterOperatorDropDownItems.All
        e.Layout.Bands(0).Columns(0).FilterOperatorDropDownItems = FilterOperatorDropDownItems.Equals Or FilterOperatorDropDownItems.NotEquals

        ' By default UltraGrid displays a clear button in each cell of the filter row
        ' as well as in the row selector of the filter row. When the user clicks this
        ' button the associated filter criteria is cleared. You can use the 
        ' FilterClearButtonLocation property to control if and where the filter clear
        ' buttons are displayed.
        e.Layout.Override.FilterClearButtonLocation = FilterClearButtonLocation.RowAndCell

        ' By default the UltraGrid performs case in-sensitive comparisons for filtering. You can 
        ' use the FilterComparisonType property to change this behavior and perform case sensitive
        ' comparisons. This property is exposed off the column as well so it can be set on a
        ' per column basis.
        e.Layout.Override.FilterComparisonType = FilterComparisonType.CaseSensitive
        e.Layout.Bands(0).Columns(0).FilterComparisonType = FilterComparisonType.CaseInsensitive

    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

		private void UltraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Enable the the filter row user interface by setting the FilterUIType to FilterRow.
			e.Layout.Override.FilterUIType = FilterUIType.FilterRow;

			// FilterEvaluationTrigger specifies when UltraGrid applies the filter criteria typed 
			// into a filter row. Default is OnCellValueChange which will cause the UltraGrid to
			// re-filter the data as soon as the user modifies the value of a filter cell. This
			// property is exposed off the the column as well so it can be set on a per column basis.
			e.Layout.Override.FilterEvaluationTrigger = FilterEvaluationTrigger.OnCellValueChange;
			e.Layout.Bands[0].Columns[0].FilterEvaluationTrigger = FilterEvaluationTrigger.OnEnterKeyOrLeaveCell;

			// By default the UltraGrid selects the type of the filter operand editor based on
			// the column's DataType. For DateTime and boolean columns it uses the column's editors.
			// For other column types it uses the Combo. You can explicitly specify the operand
			// editor style by setting the FilterOperandStyle on the override or the individual
			// columns. This property is exposed on the column as well.
			e.Layout.Override.FilterOperandStyle = FilterOperandStyle.Combo;
			e.Layout.Bands[0].Columns[0].FilterOperandStyle = FilterOperandStyle.DropDownList;

			// By default UltraGrid displays user interface for selecting the filter operator. 
			// You can set the FilterOperatorLocation to hide this user interface. This
			// property is available on column as well so it can be controlled on a per column
			// basis. Default is WithOperand. This property is exposed off the column as well.
			e.Layout.Override.FilterOperatorLocation = FilterOperatorLocation.WithOperand;
			e.Layout.Bands[0].Columns[0].FilterOperatorLocation = FilterOperatorLocation.Hidden;

			// By default the UltraGrid uses StartsWith as the filter operator. You use
			// the FilterOperatorDefaultValue property to specify a different filter operator
			// to use. This is the default or the initial filter operator value of the cells
			// in filter row. If filter operator user interface is enabled (FilterOperatorLocation
			// is not set to Hidden) then that ui will be initialized to the value of this
			// property. The user can then change the operator via the operator ui. This
			// property is exposed off the column as well.
			e.Layout.Override.FilterOperatorDefaultValue = FilterOperatorDefaultValue.StartsWith;
			e.Layout.Bands[0].Columns[0].FilterOperatorDefaultValue = FilterOperatorDefaultValue.Equals;

			// FilterOperatorDropDownItems property can be used to control the options provided
			// to the user for selecting the filter operator. By default UltraGrid bases 
			// what operator options to provide on the column's data type. This property is
			// avaibale on the column as well. Note that FilterOperatorDropDownItems is a flagged
			// enum and thus multiple options can be combined using bitwise or operation.
			e.Layout.Override.FilterOperatorDropDownItems = FilterOperatorDropDownItems.All;
			e.Layout.Bands[0].Columns[0].FilterOperatorDropDownItems = FilterOperatorDropDownItems.Equals | FilterOperatorDropDownItems.NotEquals;

			// By default UltraGrid displays a clear button in each cell of the filter row
			// as well as in the row selector of the filter row. When the user clicks this
			// button the associated filter criteria is cleared. You can use the 
			// FilterClearButtonLocation property to control if and where the filter clear
			// buttons are displayed.
			e.Layout.Override.FilterClearButtonLocation = FilterClearButtonLocation.RowAndCell;

			// By default the UltraGrid performs case in-sensitive comparisons for filtering. You can 
			// use the FilterComparisonType property to change this behavior and perform case sensitive
			// comparisons. This property is exposed off the column as well so it can be set on a
			// per column basis.
			e.Layout.Override.FilterComparisonType = FilterComparisonType.CaseSensitive;
			e.Layout.Bands[0].Columns[0].FilterComparisonType = FilterComparisonType.CaseInsensitive;
		}

Remarks

Filter rows by default display user interface for selecting filter operators in addition to the filter operands. Infragistics.Win.UltraWinGrid.UltraGridOverride.FilterOperatorLocation property can be used to hide or disable this user interface so the user can't change the filter operators. You can specify the default filter operator to use using the FilterOperatorDefaultValue property. If the filter operator ui is enable then it will be initialized to the value of this property.

See Also