expressappframework-113161-ui-construction-ways-to-access-ui-elements-and-their-controls-how-to-access-master-detail-view-and-nested-list-view-environment.md
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.
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.
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.
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.
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.
Handle the MasterObjectChanged event and process the current MasterObject when the master object changes.
In the required project of your application, create a Detail View Controller.
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