Xceed Toolkit Plus for WPF v5.1 Documentation
Xceed.Wpf.ListBox Assembly / Xceed.Wpf.ListBox Namespace / ListBox Class / Filter Event
Example


In This Topic
    Filter Event
    In This Topic
    Raised for each item in the data source that has not already been excluded by a filter expression to determine if it passes a filter.
    Syntax
    'Declaration
     
    
    Public Event Filter As EventHandler(Of ListBoxFilterEventArgs)
    'Usage
     
    
    Dim instance As ListBox
    Dim handler As EventHandler(Of ListBoxFilterEventArgs)
     
    AddHandler instance.Filter, handler
    Event Data

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

    PropertyDescription
    true if the item passes the filter; false otherwise. By default, true.
    The item to inspect.
     
    The item to inspect.  
    Remarks
    The Filter event is executed locally, meaning that all items will be retrieved from the server in order to determine those that pass the filter.
    Example
    Private Sub ListBox_Filter( ByVal sender As Object, ByVal e As ListBoxFilterEventArgs )
       Dim order As Order = CType( e.Item, Order )
     
       If order Is Nothing Then
          e.Accepted = False
       Else
          e.Accepted = ( order.ShippedDate > order.RequiredDate )
       End If
    End Sub
    private void ListBox_Filter( object sender, ListBoxFilterEventArgs e )
    {
       Order order = e.Item as Order;
     
       if( order == null )
       {
          e.Accepted = false;
       }
       else
       {
          e.Accepted = ( order.ShippedDate > order.RequiredDate );
       }
    }
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also