Using a Custom Control that is not Integrated by Default
- 4 minutes to read
XAF allows you to integrate a DevExpress control or DevExtreme widget that is not supported by default, a third-party control, or a custom control into your WinForms or ASP.NET Web Forms application. This topic provides information of different solutions and provides links to relevant examples.
You should 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.
The custom control should visualize a list of business objects (List View).
The custom control should be displayed 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, etc.
Implement a List Editor.
The custom control should visualize an individual object or value a business class property returns.
The custom control should be displayed as a Detail View’s layout element, or inside 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 data that is not bound to any business object or property.
The custom control should be displayed as a Detail View’s or Dashboard View’s layout element. The control accesses data directly (for example, it should load an objects collection using an Object Space, fetch data from a web server or load a local file), 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.
An XAF application displays a fully custom non-XAF form.
You can design a custom form or user control in Visual Studio and add them 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.
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.