Back to Devexpress

How to: Access Nested List View or Master Detail View Environment (ASP.NET Core Blazor and Windows Forms)

expressappframework-113161-ui-construction-ways-to-access-ui-elements-and-their-controls-how-to-access-master-detail-view-and-nested-list-view-environment.md

latest6.9 KB
Original Source

How to: Access Nested List View or Master Detail View Environment (ASP.NET Core Blazor and Windows Forms)

  • Jul 09, 2025
  • 5 minutes to read

This topic explains how to use Controllers to access a nested List View‘s or a master Detail View‘s environment (Frames, Controllers, Actions, Objects) in XAF ASP.NET Core Blazor and Windows Forms applications.

The topic describes two scenarios:

This topic uses an Employee Detail View and Tasks nested List View. You can find the corresponding Employee and DemoTask business classes in the XAF MainDemo application (%PUBLIC%\Documents\DevExpress Demos 25.2\Components\XAF\MainDemo.NET.EFCore).

ASP.NET Core Blazor Windows Forms

Note

XAF creates nested List Views for collection properties. These properties are often used in relationships between persistent objects.

How to: Access a Master Detail View’s Environment from a Nested List View Controller

Choose the method most suitable for your scenario:

If you need to access the master View from the DashboardViewItem or the DetailPropertyEditor, use the Access a Master Detail View’s Frame and its Controllers approach. See the E4916 article for an example.

Access a Master Detail View’s Frame and its Controllers

  1. In the required project of your application, create a nested List View Controller that receives the parent Frame in the AssignMasterFrame method. Use this Frame to customize its Controllers and Actions. For more information, refer to the following topic: Customize Controllers and Actions.

  2. In the required project of your application, create a master Detail View Controller that acquires the Detail View Frame and passes it to the NestedListViewFrameController. Use the ListPropertyEditor.FrameChanged event subscription to ensure the nested List View exists.

Access a Master Detail View’s Current Object (the View Item Approach)

  1. In the required project of your application, create a nested List View Controller. Use the CurrentObjectChanged event to update the master Detail View Caption each time the CurrentObject changes.

Access a Master Detail View’s Current Object (the Property Collection Source Approach)

  1. In the required project of your application, create a nested List View Controller. The nested List View’s CollectionSource type is PropertyCollectionSource because the List View is a collection property.

  2. Handle the MasterObjectChanged event and process the current MasterObject when the master object changes.

How to: Access a Nested List View’s Environment from a Detail View Controller

  1. In the required project of your application, create a Detail View Controller.

  2. Handle the CurrentObjectChanged event and use the CustomizeViewItemControl<T>(DetailView, Controller, Action<T>, String[]) method to obtain the current nested List View‘s Frame and object. For more information about the use of PerformLogicWithCurrentListViewObject and PerformLogicInNestedListViewController methods, refer to the following topic: Customize Controllers and Actions.

See Also

Ways to Access UI Elements and Their Controls