Version

Filtering Event

Event raised when the XamGrid is filtering data.
Syntax
'Declaration
 
Public Event Filtering As EventHandler(Of CancellableFilteringEventArgs)
Event Data

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

PropertyDescription
Cancel (Inherited from Infragistics.CancellableEventArgs) 
Column (Inherited from Infragistics.Controls.Grids.CancellableColumnEventArgs)The CancellableColumnEventArgs.Column that this event was triggered for.
FilteringOperand The FilterOperand which is being used to filter.
FilterValue The value which will be used by the filter.
RowFiltersCollection The RowFiltersCollection which is going to be modified.
Example
This sample demonstrates how to handle the Filtering event which is fired the moment right before the grid is filtered.

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.

AddHandler Me.MyDataGrid.Filtering, AddressOf MyDataGrid_Filtering

Private Sub MyDataGrid_Filtering(ByVal sender As System.Object, ByVal e As CancellableFilteringEventArgs)
   'Do not allow the ProductName column to be filtered
   If (e.Column.Key.Equals("ProductName")) Then
      System.Diagnostics.Debug.WriteLine("You cannot filter on the ProductName column")
      e.Cancel = True
      Return
   End If
   System.Diagnostics.Debug.WriteLine("Grid Filtered on value " + e.FilterValue.ToString())
End Sub
this.MyDataGrid.Filtering += new EventHandler<CancellableFilteringEventArgs>(MyDataGrid_Filtering);

void MyDataGrid_Filtering(object sender, CancellableFilteringEventArgs e)
{
   //Do not allow the ProductName column to be filtered
   if (e.Column.Key.Equals("ProductName"))
   {
      System.Diagnostics.Debug.WriteLine("You cannot filter on the ProductName column");
      e.Cancel = true;
      return;
   }
   System.Diagnostics.Debug.WriteLine("Grid filtered on value " + e.FilterValue.ToString());
}
<ig:XamGrid x:Name="MyDataGrid" 
    
Filtering="MyDataGrid_Filtering">
</ig:XamGrid>
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