バージョン

BeforeRowFilterDropDown イベント

ユーザーが列ヘッダーのフィルタードロップダウンマークをクリックしたとき、行フィルタードロップダウンがドロップダウンする前に発生します。
シンタックス
'宣言
 
Public Event BeforeRowFilterDropDown As BeforeRowFilterDropDownEventHandler
public event BeforeRowFilterDropDownEventHandler BeforeRowFilterDropDown
イベント データ

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

プロパティ解説
Cancel System.ComponentModel.CancelEventArgsから継承されます。 
Column クリックされた列ヘッダーフィルタードロップダウンボタンに関連付けられた列。
Rows UltraGridOverride.RowFilterMode が SiblingRowsOnly に解決される場合は、クリックされたフィルター ドロップダウン ボタンを持つ列ヘッダーに関連付けられた行コレクションが渡されます。そうでなければ null になります。
ValueList フィルター ドロップダウンの ValueList としての内容。このValueListでは、項目の追加や削除が可能です。
解説

BeforeRowFilterDropDown イベントを使用すると、ドロップダウンをキャンセルできます。

使用例
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
        e.Layout.Override.AllowRowFiltering = DefaultableBoolean.True
    End Sub

    Private Sub UltraGrid1_BeforeRowFilterDropDown(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownEventArgs) Handles UltraGrid1.BeforeRowFilterDropDown
        ' You can modify the ValueList in the event args. Following for loop removes
        ' Custom and Blanks items from the value list.
        Dim i As Integer
        For i = e.ValueList.ValueListItems.Count - 1 To 0 Step -1
            ' Remove Custom option from the filter drop down.
            If e.ValueList.ValueListItems(i).DisplayText.Equals("(Custom)") Then
                e.ValueList.ValueListItems.RemoveAt(i)
            End If

            ' Remove Blanks option from the filter drop down.
            If e.ValueList.ValueListItems(i).DisplayText.Equals("(Blanks)") Then
                e.ValueList.ValueListItems.RemoveAt(i)
            End If
        Next

        If GetType(String) Is e.Column.DataType Then
            Dim condition As FilterCondition
            ' You can add items with custom criteria as well by using FilterCondition object
            ' as the DataValue of the value list item.				
            condition = New FilterCondition(e.Column, FilterComparisionOperator.Match, "^[A-Ha-h]")
            e.ValueList.ValueListItems.Insert(0, condition, "A to H")

            condition = New FilterCondition(e.Column, FilterComparisionOperator.Match, "^[I-Pi-p]")
            e.ValueList.ValueListItems.Insert(1, condition, "I to P")

            condition = New FilterCondition(e.Column, FilterComparisionOperator.Match, "^[Q-Zq-z]")
            e.ValueList.ValueListItems.Insert(2, condition, "Q to Z")
        End If

        If GetType(Integer) Is e.Column.DataType Then
            Dim conditions As ColumnFilter
            ' You can also add items with custom criteria by using ColumnFilter object
            ' as the DataValue of the value list item.
            conditions = New ColumnFilter(e.Column, FilterLogicalOperator.And)
            conditions.FilterConditions.Add(FilterComparisionOperator.LessThan, 50)
            e.ValueList.ValueListItems.Insert(0, conditions, "49 and below")

            conditions = New ColumnFilter(e.Column, FilterLogicalOperator.And)
            conditions.FilterConditions.Add(FilterComparisionOperator.GreaterThanOrEqualTo, 50)
            conditions.FilterConditions.Add(FilterComparisionOperator.LessThan, 100)
            e.ValueList.ValueListItems.Insert(0, conditions, "50 to 99")

            conditions = New ColumnFilter(e.Column, FilterLogicalOperator.And)
            conditions.FilterConditions.Add(FilterComparisionOperator.GreaterThanOrEqualTo, 100)
            e.ValueList.ValueListItems.Insert(0, conditions, "100 and above")
        End If
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			e.Layout.Override.AllowRowFiltering = DefaultableBoolean.True;
		}

		private void ultraGrid1_BeforeRowFilterDropDown(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownEventArgs e)
		{
			// You can modify the ValueList in the event args. Following for loop removes
			// Custom and Blanks items from the value list.
			for ( int i = e.ValueList.ValueListItems.Count - 1; i >= 0; i-- )
			{
				// Remove Custom option from the filter drop down.
				if ( e.ValueList.ValueListItems[i].DisplayText.Equals( "(Custom)" ) )
					e.ValueList.ValueListItems.RemoveAt( i );

				// Remove Blanks option from the filter drop down.
				if ( e.ValueList.ValueListItems[i].DisplayText.Equals( "(Blanks)" ) )
					e.ValueList.ValueListItems.RemoveAt( i );
			}

			if ( typeof( string) == e.Column.DataType )
			{
				FilterCondition condition;
				// You can add items with custom criteria as well by using FilterCondition object
				// as the DataValue of the value list item.				
				condition = new FilterCondition( e.Column, FilterComparisionOperator.Match, "^[A-Ha-h]" );
				e.ValueList.ValueListItems.Insert( 0, condition, "A to H" );

				condition = new FilterCondition( e.Column, FilterComparisionOperator.Match, "^[I-Pi-p]" );
				e.ValueList.ValueListItems.Insert( 1, condition, "I to P" );

				condition = new FilterCondition( e.Column, FilterComparisionOperator.Match, "^[Q-Zq-z]" );
				e.ValueList.ValueListItems.Insert( 2, condition, "Q to Z" );
			}

			if ( typeof( int ) == e.Column.DataType )
			{
				ColumnFilter conditions;
				// You can also add items with custom criteria by using ColumnFilter object
				// as the DataValue of the value list item.
				conditions = new ColumnFilter( e.Column, FilterLogicalOperator.And );
				conditions.FilterConditions.Add( FilterComparisionOperator.LessThan, 50 );
				e.ValueList.ValueListItems.Insert( 0, conditions, "49 and below" );
				
				conditions = new ColumnFilter( e.Column, FilterLogicalOperator.And );
				conditions.FilterConditions.Add( FilterComparisionOperator.GreaterThanOrEqualTo, 50 );
				conditions.FilterConditions.Add( FilterComparisionOperator.LessThan, 100 );
				e.ValueList.ValueListItems.Insert( 0, conditions, "50 to 99" );

				conditions = new ColumnFilter( e.Column, FilterLogicalOperator.And );
				conditions.FilterConditions.Add( FilterComparisionOperator.GreaterThanOrEqualTo, 100 );
				e.ValueList.ValueListItems.Insert( 0, conditions, "100 and above" );
			}
		}
参照