Version

RecordFilterDropDownOpening Event

Raised before record filter drop-down is opened but after RecordFilterDropDownPopulating event.
Syntax
'Declaration
 
Public Event RecordFilterDropDownOpening As EventHandler(Of RecordFilterDropDownOpeningEventArgs)
public event EventHandler<RecordFilterDropDownOpeningEventArgs> RecordFilterDropDownOpening
Event Data

The event handler receives an argument of type RecordFilterDropDownOpeningEventArgs containing data related to this event. The following RecordFilterDropDownOpeningEventArgs properties provide information specific to this event.

PropertyDescription
DropDownItems Returns the items that will be displayed in the filter drop-down. You can modify the list to add new entries or remove existing entries from the filter drop-down.
Field Returns the associated Field (read-only).
Handled (Inherited from System.Windows.RoutedEventArgs)Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
ItemsType Returns an enumeration indicating whether the DropDownItems or MenuItems are used to populate the drop down.
MenuItems Returns the menu items that will be displayed in the filter drop-down. You can modify the list to add new entries or remove existing entries from the filter drop-down.
OriginalSource (Inherited from System.Windows.RoutedEventArgs)Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
RaisedForCustomFilterSelectionControl Returns true if this event is raised when the user drops down the filter drop-down in the custom filter selection control.
RecordManager Returns the associated RecordManager (read-only).
RoutedEvent (Inherited from System.Windows.RoutedEventArgs)Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
Source (Inherited from System.Windows.RoutedEventArgs)Gets or sets a reference to the object that raised the event.
Remarks

RecordFilterDropDownOpening is raised whenever the user drops down the filter drop-down in a filter cell or via the filter icon of a field label (see FieldLayoutSettings.FilterUIType). You can manipulate the list of items that will be displayed in the filter drop-down using the DropDownItems property of the event args. Also note that the RecordFilterDropDownPopulating is raised before this event.

Example
The following code demonstrates usage of RecordFilterDropDownOpening event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

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

    Private Sub Dp_RecordFilterDropDownOpening(ByVal sender As Object, ByVal e As RecordFilterDropDownOpeningEventArgs)
        ' Field property returns the field for which the filter drop-down is opening.
        Dim field As Field = e.Field

        ' RecordManager property returns the record manager associated with the data
        ' records that are being filtered. This is especially pertinent with hierarchical
        ' data source where multiple child data record collections exist. This lets
        ' you know for which data record collection the filter drop-down is being dropped
        ' down.
        Dim recordManager As RecordManager = e.RecordManager

        ' RaisedForCustomFilterSelectionControl property indicates if the drop-down is 
        ' being opened inside the custom filter dialog or within the data presenter itself.
        Dim isRaisedFromWithinCustomFilterDialog As Boolean = e.RaisedForCustomFilterSelectionControl

        ' DropDownItems property returns items that will be displayed in the drop-down.
        ' You can manipulate the list and add your own items to it or remove existing 
        ' items from it.
        Dim dropDownItems As ObservableCollection(Of FilterDropDownItem) = e.DropDownItems

        Debug.WriteLine("Record filter drop-down is opening for field " & field.Name)
    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_RecordFilterDropDownOpening( object sender, RecordFilterDropDownOpeningEventArgs e )
		{
			// Field property returns the field for which the filter drop-down is opening.
			Field field = e.Field;

			// RecordManager property returns the record manager associated with the data
			// records that are being filtered. This is especially pertinent with hierarchical
			// data source where multiple child data record collections exist. This lets
			// you know for which data record collection the filter drop-down is being dropped
			// down.
			RecordManager recordManager = e.RecordManager;

			// RaisedForCustomFilterSelectionControl property indicates if the drop-down is 
			// being opened inside the custom filter dialog or within the data presenter itself.
			bool isRaisedFromWithinCustomFilterDialog = e.RaisedForCustomFilterSelectionControl;

			// DropDownItems property returns items that will be displayed in the drop-down.
			// You can manipulate the list and add your own items to it or remove existing 
			// items from it.
			ObservableCollection<FilterDropDownItem> dropDownItems = e.DropDownItems;

			Debug.WriteLine( "Record filter drop-down is opening for field " + field.Name );
		}
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                            
RecordFilterDropDownOpening="dp_RecordFilterDropDownOpening"
                                        
>

            
<igDP:XamDataGrid.FieldSettings>
                
<!--Set AllowRecordFiltering to enable filter-record.-->
                
<igDP:FieldSettings AllowRecordFiltering="true" />
            
</igDP:XamDataGrid.FieldSettings>
            
        
</igDP:XamDataGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also