Xceed Toolkit Plus for WPF v4.6 Documentation
SelectionRange Constructor(FilterExpressionBase,Predicate<Object>)
Example 


Xceed.Wpf.ListBox Assembly > Xceed.Wpf.ListBox Namespace > SelectionRange Class > SelectionRange Constructor : SelectionRange Constructor(FilterExpressionBase,Predicate<Object>)

The FilterExpression to be used to filter the items server-side. Can be a null reference (Nothing in Visual Basic).

The filter predicate to be used to filter the items locally (see Remarks section). Can be a null reference (Nothing in Visual Basic).
Initializes a new instance of the SelectionRange class specifying filtering criteria. If this constructor is used, all items that pass the filters will be selected.
Syntax
'Declaration
 
Public Function New( _
   ByVal filterExpression As FilterExpressionBase, _
   ByVal filter As Predicate(Of Object) _
)
'Usage
 
Dim filterExpression As FilterExpressionBase
Dim filter As Predicate(Of Object)
 
Dim instance As New SelectionRange(filterExpression, filter)
public SelectionRange( 
   FilterExpressionBase filterExpression,
   Predicate<object> filter
)

Parameters

filterExpression

The FilterExpression to be used to filter the items server-side. Can be a null reference (Nothing in Visual Basic).

filter
The filter predicate to be used to filter the items locally (see Remarks section). Can be a null reference (Nothing in Visual Basic).
Remarks

Predicates (i.e., filter parameters of various SelectionRange constructors) are executed locally, meaning that when the BeginGetSelectedItems and EndGetSelectedItems methods are called and a selection range that provides a predicate is used, items will be retrieved from the server in order to determine those that pass the filter.

If one or more start and end range information is provided and/or a filter expression, only the items that are not already excluded by the range information and filter expression will be retrieved.

In a virtualized environment, it is not recommended to use the filter predicate unless dealing with a very limited number of items.

Example
Additional examples that demonstrate how to select data programmatically can be found in the Selecting Data topic.
Dim leftExpression As New FilterExpression( "ShipVia", FilterOperator.Equal, 3 )
Dim rightExpression As New FilterExpression( "OrderDate", FilterOperator.GreaterThanOrEqual, New DateTime( 2008, 01, 01 ) )
 
Dim expression As New OrFilterExpression( leftExpression, rightExpression )
 
Dim range As New SelectionRange( expression, Nothing )
 
Me.sllbListBox.SelectedRanges.Clear()
Me.sllbListBox.SelectedRanges.Add( range )
FilterExpression leftExpression = new FilterExpression( "ShipVia", FilterOperator.Equal, 3 );
FilterExpression rightExpression = new FilterExpression( "OrderDate", FilterOperator.GreaterThanOrEqual, new DateTime( 2008, 01, 01 ) );
 
OrFilterExpression expression = new OrFilterExpression( leftExpression, rightExpression );
 
SelectionRange range = new SelectionRange( expression, null );
 
this.sllbListBox.SelectedRanges.Clear();
this.sllbListBox.SelectedRanges.Add( range );
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

Reference

SelectionRange Class
SelectionRange Members
Overload List