Xceed Toolkit Plus for WPF v5.0 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 );
       }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, 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