Customizing Complex Forms for XAF Applications: Challenges and Solutions | CodeGuru

Customizing Complex Forms for XAF Applications: Challenges and Solutions

By Sergey Zaitsev DevExpess XAF is a very useful tool for creating rich line-of-business applications simply and quickly. However, there are certain issues developers can experience when creating complicated forms, especially when it comes to the form view customization. Being loyal XAF users ourselves and often working with large and complicated forms, we decided to […]

Written By
CodeGuru Staff
CodeGuru Staff
Jun 20, 2016
3 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

By Sergey Zaitsev

DevExpess XAF is a very useful tool for creating rich line-of-business applications simply and quickly. However, there are certain issues developers can experience when creating complicated forms, especially when it comes to the form view customization. Being loyal XAF users ourselves and often working with large and complicated forms, we decided to cover some of the issues we face, as well as several ways to solve them.

One of the most common challenges we as developers faced was customizing the form’s layout to the customer’s business processes. There are several ways to address this issue. One way to address it is to use the Model Editor, when you just go to DashboardView -> DetailView -> Layout, and arrange the layout the way you need by dragging and dropping the elements of the form in the Customize Layout mode (invoked by a right click). No actual coding is required for this.

Complex1
Figure 1: The Customize Layout Mode

Two other solutions to this problem involve basic coding, and they are: applying a DetailViewLayoutAttribute to required properties or using the Layout Control to customize the form view.

Another challenge is creating “role” forms that require minor differences when displaying a complex form for different user roles. Different views of the form can be developed by using the View Variants Module. It allows the developer to create various form views during the design time, and the end user&kmdash;to choose the required view variant at the runtime. In a nutshell, you’ll just have to add a new ListView or DetailView node to the Views node for each view required, add view a variants node, and define the settings and properties as required.

Complex2
Figure 2: The View Variants Module

One more issue a lot of developers face is business objects data extension in case one needs to show information not related initially to the business object type. It can be done using the Model editor: Views, without modifying the code, by the developer or application administrator. To do so, one has to add a custom calculated field to the form as follows:

  1. Invoke the Model Editor.
  2. Add a model member (BOModel | <Class> | OwnMembers | Add… | Member).

Complex3
Figure 3: Adding a Model Member

  1. Specify its name and type values.
  2. Pass the expression that will be used to compute the field.
  3. Finally, restart the Model Editor and create a Detail View item or List View column for the newly added custom field (refer to Figure 2).

In Conclusion

There are several possibilities to customize the view of complex XAF forms for all kinds of business purposes, involving various amounts of coding and thus applicable at various stages of application development or runtime.

About the Author

Sergey Zaitsev is the lead developer at Galaktikasoft. Having years of experience with XAF behind his back, he is an expert in solving all types of issues related to using this and other frameworks for business application development.

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.