Skip to content

DevExpress-Examples/XAF_how-to-show-filter-dialog-before-listview

Repository files navigation

XAF - How to show a filter dialog before a List View

This example displays a pop-up filter dialog that allows users to set a filter for a list view before the application starts to load list view data. Users can create filters and save them in a data source. This approach can be useful when the list view contains a large amount of data.

Filter for ListView

Implementation Details

  1. Extend the Application Model with an additional property.
    • Implement an interface that exposes the AdditionalCriteria property. This property stores the applied filter criteria.
    • Override the ExtendModelInterfaces method of your base Module to extend the Application Model with the declared interface and the AdditionalCriteria property.
  2. Create the ViewFilterObject class. Instances of this class store user filters.
  3. Create the non-persistent ViewFilterContainer class. An object of this class contains a list of user filters (ViewFilterObject objects) and the currently applied filter. The ViewFilterContainer's Detail View serves as the filter dialog.
  4. Implement ShowFilterDialogController to display the filter dialog. When a user selects a filter and clicks the OK button, the controller assigns the corresponding filter criteria to the AdditionalCriteria Application Model property.
  5. Implement NewViewFilterObjectController to initialize a new instance of the ViewFilterObject class when a user clicks New in the ViewFilterObject lookup List View.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Contributors 7