Skip to main content
All docs
V23.2
.NET 6.0+

Runtime Layout Customization in ASP.NET Core Blazor Applications

  • 4 minutes to read

XAF ASP.NET Core Blazor applications support View Item layout customization in a Detail View at runtime.

You can customize the layout in a simple Detail View and Split Layout.

Enable Layout Customization

This functionality is available by default.

To activate customization mode, right-click an empty space in the Detail View you want to edit and select the Customize Layout option in the context menu.

Customize Layout In a Detail View of an XAF ASP.NET Core Blazor Application, DevExpress

The invoked Customization Form contains a structured view of all View Items available in the Detail View and a list of View Items hidden in the Detail View.

Customization Form In a Detail View of an XAF ASP.NET Core Blazor Application, DevExpress

To deactivate customization mode, close the Customization Form or right-click an empty space and select the Hide Customization Form option from the context menu.

Disable Layout Customization

To disable runtime layout customization in a specific Detail View: open the Model Editor, navigate to the Views | <Namespace> | <Class>_DetailView node, and set the CustomizationEnabled property value to false.

To disable runtime layout customization in all Views, open the Model Editor, navigate to the Options | LayoutManagerOptions node, and set the CustomizationEnabled property to false.

Persist Layout Customization For Individual Users

A user can customize a Detail View’s layout according to their needs. XAF stores the changes in the user differences layer of the Application Model independently for each user. The next time a user invokes a customized View, XAF applies the most recent changes.

XAF supports this behavior by default if you used the Solution Wizard and selected the Standard Authentication option on the Choose Options page. For more information on how to enable this behavior in an existing application, refer to the following topic: Store Application Model Differences in the Database.

The following article describes how users can share changes made during runtime layout customization: Enable the Administrative UI to manage End-User Settings in the Database.

Supported Scenarios

Change a View Item’s Position

Drag a View Item and drop it at the required position. A blue line indicates where you can place the View Item.

Change a View Item's Position in Customization Mode, DevExpress

Note

If an item group becomes empty as a result of this action, it disappears from the layout.

Resize a View Item

Drag a vertical splitter between adjacent View Items.

Resize an Item in Customization Mode, DevExpress

Note

When you release the splitter, it sticks to the nearest 1/12th of the container width because of Blazor’s Form Layout Structure. You can use nested groups with hidden captions to resize View Items with more precision.

Hide a View Item

You can use either of the following options:

  • Right-click an item and select the Hide Item option in the context menu.

    Context Menu Option to Hide an Item in Customization Mode, DevExpress

  • Drag an item to the Hidden Items list in the Customization Form.

    Drag-n-Drop to Hide an Item in Customization Mode, DevExpress

Note

If you hide an entire group, all its View Items become hidden and the group itself disappears from the layout.

Display a Hidden View Item

Drag a View Item from the Customization Form and drop it at the required position.

Drag-n-Drop to Display a Hidden Item in Customization Mode, DevExpress

Create a Group

Right-click a View Item you want to add to a group and select the Group option in the context menu.

Create a Group in Customization Mode, DevExpress

Use the context menu to ungroup View Items.

Create a Tabbed Group

Right-click an item or a group’s caption and select the Create Tabbed Group option in the context menu.

Create a Tabbed Group in Customization Mode, DevExpress

Convert a Group To a Tab

Click a group, then right-click a tabbed group’s header and select the Convert Selected Group to Tab option in the context menu.

Convert a Group To a Tab in Customization Mode, DevExpress

Reset View Item Layout

If you need to revert your changes, right-click an empty space in a Detail View at runtime and select the Reset Layout option in the context menu.

Reset Layout Changes In a Detail View of an XAF ASP.NET Core Blazor Application, DevExpress

Limitations of Runtime Layout Customization

XAF does not support runtime layout customization in the following elements:

It is also not available on smartphones or mobile devices with small displays.

See Also