Filtering
RadCardView supports filtering via the UI or in code, in case you are using ICollectionView as the ItemsSource.
The control internally works with a QueryableCollectionView instance. If you set the ItemsSource of the RadCardView that is not a QueryableCollectionView, then the original collection is wrapped in a QueryableCollectionView instance. This way filtering is supported even if you use a more basic IEnumerable implementation, like List<T>
or ObservableCollection<T>
.
Filtering in the UI
The data items can be filtered using the filtering control which opens when a data field descriptor's filters button is pressed.
Figure 1: RadCardView filtering control
To disable user filtering, set the IsFilteringAllowed property to False.
Example 1: Setting the IsFilteringAllowed property
Programmatic Filtering
The following example shows how to setup RadCardView, populate it a QueryableCollectionView and add FilterDescriptors in code.
Example 2: Defining the model
Read the QueryableCollectionView to see how to use the FilterDescriptors collection of the QueryableCollectionView.
Example 3: Setting the DataContext
Example 4: Setting up the view
Events
The filtering operations invoke several events that can be used to customize the filtering. Read more in the Events article.
Filter Member Path
The filtering uses the property bound to the DataMemberBinding property of the corresponding CardDataFieldDescriptor. To change this, set the FilterMemberPath property of the descriptor. The path should point to a property in the underlying data item.
Example 5: Setting the FilterMemberPath property
Deferred Filtering
Selecting a filter in the filtering control will apply it immediately to the items. To change this, set the IsFilteringDeferred property of the corresponding CardDataFieldDescriptor to true. This will require a press of the Filter button in order to commit the filters.
Example 6: Setting the IsFilteringDeferred property
Customizing Filtering UI
The UI of the filtering control can be customized using several properties of RadCardView and CardDataFieldDescriptor. Read more in the Customizing Filtering Control article.