GithubHelp home page GithubHelp logo

devexpress-examples / xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection Goto Github PK

View Code? Open in Web Editor NEW
1.0 55.0 2.0 292 KB

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

License: Other

C# 75.33% HTML 24.67%
dotnet xaf framework dashboard dashboard-view ef-core expressapp expressapp-framework expressappframework xpo

xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection's Introduction

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+

xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection's People

Contributors

andreykozhevnikov avatar devexpressexamplebot avatar kill4kan avatar nikolaevairina avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.