Search This Blog


Thursday, September 15, 2016

Simplifying customization of Action controls - YOUR FEEDBACK IS NEEDED!

As you know, XAF provides abstractions for common UI elements like list and detail forms, their editors, main and navigation menus, etc. that enable XAF developers to accomplish common tasks for several supported platforms with less effort. Today I want to take a moment of your time and focus on popular customization tasks related to Actions - typically abstract UI elements that allow you to perform specific operations in response to end-user manipulations.

For instance, the ActionBase class, which is the super class for all Action types provides many useful members like Caption, ToolTip, Shortcut, PaintStyle, Enabled, Active, etc. that help you care less of technical implementation details for each specific platform or situation, at least for the popular tasks these members were designed for. It is also super easy to manage these properties and events in code or via the visual designers like the Visual Studio component designer for Controller or our own Model Editor.

Current approaches for customizing Action controls

The above looks very well (and many XAFers expressed this is one of the things they love the product for) and we have always been trying to keep this promise when designing our framework:
common and simple tasks can be done easily, while any specific or complex tasks are technically possible

But what about the second part of this promise with regard to Actions in practice? To answer this, it is best to evaluate it yourself for various tasks. Our documentation and support knowledge base contains many code examples for customizing Action controls in various places of an XAF application, and I grouped them below for your review.

How to provide a specific View layout for users of certain security roles

I would like to quickly promote a recent update to our old Code Example in the support database:
I hope you find this solution helpful. Let me know in case of any questions, suggestions or share your experience with other XAFers on how you are doing a similar task at the moment. Thanks!

This example demonstrates how to show a custom View against a role of the currently logged user. Custom Views were created and customized through the Model Editor for each role separately. For more convenience, custom Views have a name of a role in the Id attribute. For instance: Contact_ListView_Administrators, Contact_DetailView_Administrators, Contact_ListView_Users, Contact_DetailView_Users, etc. You may consider a specific naming convention, for example, to add a role name to the end of the view name. Use User and Admin user names with empty password to login into the application.

Implementation details:
There is E274.Module\Controllers\CustomizeViewAgainstRoleMainWindowController that tracks View showing using theXafApplication.ViewCreating event and replaces the default View's Id with a custom Id found in the Application Model by the role name. 

Monday, September 12, 2016

Why can a DetailView be not editable or display empty values?

This small thing may hit even experienced XAFers, so I want to post this tip here for the future. In fact, I created a corresponding KB article a few months ago, but forgot to promote it in my blog. So, here we go:

1. You are creating a new detail form via the XafApplication.CreateDetailView API in a Web application, but it does not allow users to enter any information; e.g., they can't write/select anything into/from lookups. The View controls also look "readonly" or disabled. The same code produces an editable DetailView in WinForms, though.
2. Same readonly View editors as in the previous point, but the controls do not display any values either + the code does not work in both WinForms and ASP.NET apps.
3. You are opening a DetailView of an object that was deleted by another user. This way, this behavior is normal and expected as removed data can no longer be edited.

1. Make sure you have set the DetailView.ViewEditMode property to the DevExpress.ExpressApp.Editors.ViewEditMode.Edit value. For example, check the snippet from this KB Article:

Monday, September 5, 2016

About searching freelancers, programmers, consultants with the DevExpress expertise and XAF in particular

I have recently come back from a 3 week vacation on Crete and I feel in a good mood for blogging. BTW, in my first-time experience, this place has a plethora of sights for both active and cultural holidays, crystal clean sea, tasty traditional and sea food, fruits plus Greeks being very nice people all with a funny Tolis-like accent:-) - it will be the reason for my pleasant memories again and again.

Today, I want to cover a question which I periodically receive privately or in the Support Center:

"Can you recommend anyone that might be interested in working as a consultant/programmer to help us develop our XAF app?"

Well, there are surely many developers that can qualify for this, and the first and probably the best way of locating XAF freelancers (as well as freelancers for any other technology) is using specialized services like and I just picked the two ones from the top of my head, so there may be alternatives and you must learn more on them first. For instance, check these example queries:

Thursday, September 1, 2016

Minor usability improvement - Nullable values support for boolean property editors

In short, this feature was already supported by the underlying WinForms CheckEdit and ASP.NET ASPxCheckBox controls, but it required writing some custom code in XAF apps. Now this coding is no longer required for XAF users if they need a Nullable<bool> property.

Starting with v16.1.6, the two built-in XAF editors support boolean Nullable properties. In the UI, when the check box is used, nullable properties will be displayed using a third 'grayed' state. When a drop-down editor is used, an empty 'null text' item will be available. Technically, the PropertyEditor.AllowNull must return True for the aforementioned UI transformations to take effect.

Please see the following code examples and screenshots for more details:

        public bool? ThreeStateCheckBox {
        [CaptionsForBoolValues("Checked", "Unchecked")]
        public bool? ThreeStateDropDown {