Skip to main content

How to: Include a Custom UI Control That Is Not Integrated by Default (WinForms, ASP.NET WebForms, and ASP.NET Core Blazor)

  • 5 minutes to read

XAF uses standard and DevExpress controls for all UI elements such as List Editors, Property Editors for default data types, View Items, Actions, Action Containers, Templates, and so on. For scenarios not covered by the built-in XAF UI elements, XAF allows developers to integrate any other DevExpress, standard (Microsoft), and third-party UI controls into Views. This topic groups solutions by popular UI tasks.

These tasks are often performed at a lower framework level and require more knowledge and experience with XAF. This is the same knowledge required if you were to code an app without our framework. XAF-related benefits and time savings are minimal for those who want to integrate custom controls. As a rule of thumb, you should first know how to solve and optionally implement your task in a non-XAF app. This makes XAF integration much easier. For more information, refer tp the following article: Advanced UI Customization Tips.

To include a custom UI control that is not integrated by default, implement a ListEditor, PropertyEditor, or ViewItem that wraps the control and serves as an adapter for the XAF infrastructure. You can also customize a template to place the control in a specific location. Refer to the table below for details on the different solutions.

Task

Task Details

Solution                                                                                                          

The custom control should visualize a list of business objects (List View).

The custom control should appear when a user selects a Navigation item, executes a PopupWindowShowAction, or opens a Detail View of the object that contains a nested collection. For example, you can use an image gallery control to display photos, a map control to display a list of addresses as map markers, and so on.

Implement a List Editor.

The custom control should visualize a value returned by a business class property.

The custom control should appear as a Detail View’s layout element, or within a grid cell in a List View. For example, you can use a trackbar control to edit a numeric value, a gauge control to display a numeric value as a circular indicator, a PDF viewer control to preview an attached document, etc.

Implement a Property Editor.

The custom control should visualize complex data that depends on multiple objects or properties or data that is not bound to any business object or property.

The custom control should appear as a Detail View’s or Dashboard View’s layout element. The control accesses data directly (for example, it should load an object collection using an Object Space, fetch data from a web server, load a local file), uses data from multiple properties of a business object, or displays static content.

Implement a View Item.

The custom control should be added to the application window outside the View area.

 

Create a custom Template and drop the control on it.

The custom control should be added to the main or navigation menu.

Standard Action types do not cover the scenario or cannot be customized using the existing API.

Create a custom Action type.

An XAF application displays a fully custom non-XAF form.

You can design a custom form or user control in Visual Studio and add it to your XAF application. In most cases, you can create a Controller and show the form on an Action‘s Execute event.

Show a custom form.

Note

ASP.NET Web Forms controls that use the ClientScriptManager.RegisterStartupScript method cannot be integrated using the examples above. If you experience any difficulties when integrating ASP.NET Web Forms controls, contact our Support Team.