eXpressApp Framework - Tips & Tricks (March 2020)

XAF Team Blog
01 April 2020

It’s a difficult time for many – our hats off to the brave men and women helping heal those affected by the virus. We’ll get through this together.

We are working hard to get our next major release out the door in the next 45 days. We expect to share more information on the release and what we expect to include shortly. In the meantime, here’s this month’s edition of XAF Tips & Tricks. We hope it’s of value…

Interesting Support Tickets

Usability & Performance Enhancements

Documentation Updates

Simplified Permission Checks in Custom Code

We extended the SecurityStrategy class with numerous methods you can use to check if a user can perform CRUD operations: IsGrantedExtensions. For supplementary information, please review the following article: How to: Display a List of Users Allowed to Read an Object.

List View Data Access Modes

We have redesigned online documentation for the following important concepts and added comparison tables. We also fully documented our new ServerView and InstantFeedbackView modes.

Please let us know if this information is of value or if you feel we need to add additional content to help you select the appropriate mode for specific usage scenarios.

Simplified Access to Detail View Editors

You can now avoid ViewItem.ControlCreated and other event handlers for many common usage scenarios - simply use our DetailView.CustomizeViewItemControl method inside the OnActivated method to customize View item controls. You no longer need to unsubscribe from events or check whether controls are created. Please let us know your thoughts.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using DevExpress.XtraEditors;
// ...
public class SetMinValueController : ObjectViewController<DetailView, DemoTask> {
    protected override void OnActivated() {
        base.OnActivated();
        View.CustomizeViewItemControl(this, SetMinValue);
    }
    private void SetMinValue(ViewItem viewItem) {
        SpinEdit spinEdit = viewItem.Control as SpinEdit;
        if (spinEdit != null) {
            spinEdit.Properties.MinValue = 0;
        }
    }
}​

Security System - New Code Example & KB Article

This GitHub repository demonstrates how to generate database updater code for security roles created via the application UI in a development environment. This KB article explains how to prevent deletion of the last active Administrator and the last administrative role with active users.

Showcase Your Apps on DevExpress.com

Highlight your business app and share your development experiences with the DevExpress community. To include your app in our upcoming App Showcase, please forward an application screenshot to clientservices@devexpress.com and tell us which DevExpress products you currently use within your organization.
10 comment(s)
Martin Praxmarer - DevExpress MVP
Martin Praxmarer - DevExpress MVP
DetailView.CustomizeViewItemControl - nice one! thx for this!
1 April 2020
Wei  Chen
Wei Chen

I found that every post in the original industry prompts to send an app show case.

I have sent an email to clientservices@devexpress.com on March 29th. How long will it take to get results or reply to me?

Thank you 

1 April 2020
Eric Upton 1
Eric Upton

Simplified access to detail view editors. Yes!

That's a great addition. Thanks!

1 April 2020
Dennis (DevExpress)
Dennis (DevExpress)
@Martin Praxmarer, Eric Upton: You're always welcome!
@Wei Chen: We received your screenshots and we’ll be in touch to discuss further.
1 April 2020
Mario Blatarić
Mario Blatarić

Thanks for detailed Data Access modes documentation, that is really helpful. 

I was very enthusiastic reading through InstantFeedbeck, until last point - OpenObject does not work. It is incredibly useful and very often used action which I can not give up - is there really no way to implement it in InstantFeedback, even if it sacrifice some performance? 


Simplified ViewItem customization - big thanks to this one. I am actually tempted to refactor my entire codebase. 

2 April 2020
he dandan
he dandan
Is the official team affected by the COVID-19?
Will XAF Blazor be delayed?
2 April 2020
Dennis (DevExpress)
Dennis (DevExpress)

@he dandan: We are all doing well. Thank you for asking. We hope you, your family and your teammates are unaffected by the pandemic.

No, why?

3 April 2020
Alex Gn (DevExpress)
Alex Gn (DevExpress)

Hello Mario,

I want the OpenObject Action to be available in DataView and these new modes like you do. Unfortunately, it works only in modes that contain real objects (Client, Server). In all other modes we have only a set of scalar values to display and OpenObject is not easy to support in a generic way.

3 April 2020
Mario Blatarić
Mario Blatarić

@Alex - thanks for your response. Yes, I understand it is not trivial, however, maybe it could be solved with some additional metadata either using attributes or DataView columns declaration, I will throw my idea here.

I am actually much more interested in InstantFeedback and InstantFeedbackView (and also ServerView) than DataView, and I would not mind to set additional attribute in code, or in Model Editor, something like ActualObjectType and ActualObjectKeyField defined for column which would also mean that Oid field from target table would have to be present in Columns (maybe with Visible to false or Index to -1), but would be retrieved from database and type + oid information would allow you to enable OpenObject action. 

As an example, if I would want LastName and FirstName for Person table in Invoice_ListView, I would also add Oid column from Person table, and to all three columns I would assign ActualObjectType to Person (this could probably be automatic because when I select LastName, I have to expand Person property, so you already know this column is from person table - you only need Oid information for those column and I would assign Person.Oid for all three columns - which could allow OpenObject on all three columns. 

This could be very generic solution and no one would be forced to use it, it would be completely optional and would provide so much needed OpenObject functionality. 

6 April 2020
Alex Gn (DevExpress)
Alex Gn (DevExpress)
@Mario: Thank you for your feedback.
6 April 2020

Please login or register to post comments.