Add an Editor to a Detail View
- 2 minutes to read
This lesson explains how to add an editor to a Detail View. In this example, we add an editor for the Department.Office property to the Contact Detail View.
Before you proceed, take a moment to review the following lesson:
In the MySolution.Module project, open the Model.DesignedDiffs.xafml file in the Model Editor.
Navigate to the Views | MySolution.Module.BusinessObjects node. Expand the Contact_DetailView child node and click the Layout node.
The Model Editor displays a design surface that imitates the Contact Detail View. Right-click the View’s empty space and choose Customize Layout.
In the invoked Customization window, click the Add button.
In the Object Model dialog, expand the Department node, select the Office field, and click OK.
The Office: item appears on the Hidden Items tab of the Customization window.
Drag the Office: item to the required position on the Contact Detail View.
Run the WinForms or ASP.NET Web Forms application and invoke a Contact Detail View. The Office editor is located in the same column as the Department editor, Position editor, and other editors.
You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 22.1\Components\XAF\MainDemo by default. The ASP.NET Web Forms version is available online at https://demos.devexpress.com/XAF/MainDemo.
In the customization mode that we activated in step 3 of this lesson, you can change the Detail View layout. See the following topic for more information: Customize the View Items Layout.
Users can also customize the Detail View layout. The following topic describes how to change the layout at runtime: Default Runtime Customization.
In addition, you can customize the Contact Detail View layout at runtime, and merge these changes into the MySolution.Module project. See the following topic for details: How to: Merge End-User Customizations into the XAF Solution.