Skip to content

How to filter a ListView displayed in a DashboardView based on another ListView's selection

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XAF - How to implement dependent views in a DashboardView (filter based on selection)

This example illustrates how to filter a ListView displayed in a DashboardView based on another ListView's selection.

Scenario

When a DashboardView contains several list views, it is often required to make them dependent, e.g. display items of one ListView based on items or selection of another ListView.

chrome_WHVRxufQHv

Implementation Details

  1. Add a new ViewController to the YourSolutionName.Module project. For more information, refer to the following file: DashboardFilterController.cs.
  2. In the OnActivated method, retrieve DashboardViewItems via the FindItem method, and subscribe to the ControlCreated event of a DashboardViewItem whose ListView is used to filter data (hereinafter referred to as SourceView).
  3. In the ControlCreated event handler retrieve the SourceView via the DashboardViewItem.InnerView property and subscribe to its SelectionChanged event.
  4. In the SelectionChanged event handler, retrieve the View to be filtered (hereinafter referred to as TargetView) in the same way as the previous step.
  5. To get an object that is used for filtering, use the ListView.CurrentObject property.
  6. You can now add CriteriaOperator to the TargetView.CollectionSource.Criteria dictionary to filter the TargetView. In this example, we created an InOperator that uses SourceView objects to filter the AssignedTo column.

Files to Review

Documentation

ASP.NET WebForms Version

You can find the ASP.NET WebForms version of this example in the following branch: DevExpress-Examples/xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection at 17.2.3+

Does this example address your development requirements/objectives?

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

Releases

No releases published

Packages

No packages published