Using a Custom Control that is not Integrated by Default
- 4 min 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, ASP.NET or Mobile application. This topic provides information of different solutions and provides links to relevant examples.
Custom Controls in WinForms and ASP.NET Applications
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.
Show a custom form.
ASP.NET controls that use the ClientScriptManager.RegisterStartupScript method cannot be integrated using the examples above. If you experience any difficulties when integrating ASP.NET controls, contact our Support Team.
Custom Controls in a Mobile Application
You can add custom controls and widgets to a Mobile application using XAF Mobile Custom Modules. The following topics describe how you can implement an XAF Mobile Custom Module in your application: