DevExpress XAF is a framework for .NET and Visual Studio developers who wants to create Office-like LOB apps for desktop, web and mobile faster and without hiring a large team.
This is something I needed myself several times and what was also requested by several customers in the past. Hopefully, you will find this new capability helpful for your project as well.
We continue empowering one of the most popular features among our users, which we backed into the standard framework delivery in the v14.2 major release - Persisting UI Settings in the Database.
Turning off the tabbed MDI mode can temporarily help you avoid this error, but this is not very suitable. So, I strongly recommend youdownload a patch from here.
Please accept sincerely apologies from our team for all the inconvenience here.
#2.If the DetailView was first opened in the View mode from a root ListView, then switched to the Edit mode by an end-user via the Edit Action, then Save & Close will save the changes and return you back to the View mode instead of closing and showing the source ListView.
We received only a couple of comments on this very point and since this change is not very important to us, we wanted to make sure the new behavior meets the needs of the most users. So, I would kindly ask you take a minute to leave a comment to my blog post on the desired behavior you would like to see in this situation. Thank you in advance!
P.S. I personally tend to think that this should be a real "close" result = navigating back to the ListView regardless the DetailView was in the View mode before or not. But you may disagree and consider this as navigating back to the previous view state in the stack...who knows...
As you probably know, we already have a built-in solution for checking this condition within criteria - IsCurrentUserInRole criteria function (learn more from my blog...).
Doing the same in C# or VB.NET code is also possible with LINQ or a simple 'foreach' (through the SecuritySystem singleton), it would still be great to have a more straightforward and built-in method for this common task, especially for newbies.
Good news is that starting with version 14.2.7, this task can be done more easily. Let me quote the provided solution details from this Support Center thread:
Now, you can determine whether a user belongs to a certain role in code using the IsUserInRole extension method. This method is available for both ISecurityUserWithRoles (new Security System) and IUserWithRoles (legacy Security System) user types.
In addition to the implementation instructions, there was a sample project that should have helped you get all the pieces of the puzzle together. It was not complete implementation by any means (some scenarios were not implemented intentionally), but rather a demonstration of how that is possible in general with an intent for users to further extend and test this solution according to your exact business requirements and Google Maps API docs :-).
Unfortunately, there was not much interest and feedback from users on this basic implementation and, more importantly, on their business requirements, nor on the info on how the Google Maps component helps end-users do their work easier. We require this essential information in order to investigate whether or not it is possible to provide a universal and useful solution for this scenario as part of the standard framework delivery.
This blog post is one more attempt to collect this information from you, guys, I greatly appreciate your input in advance. I am also writing this because I've recently extended the original example implementation by supporting a few more things, which I think the majority would want to have by default. These are: opening geo point details in DetailView after clicking on it within a a map, the possibility to not only display a point's information in detail form, but also to edit its details when we are in the Edit mode with the help of ASPxObjectPropertyEditor. I demonstrated the latest features in the video below:
If you faced a requirement to use Google Maps or any other similar map control to better meet the needs of your clients, I would greatly appreciate it if you email me at dennis@devexpress.com and tell the details of your real use-cases along with the screenshots, videos and other info.
To formalize this a bit and make it easier for you to answer (and for us to process too), see the four simple points:
I wanted to share a link to a hot Support Center discussion on the subject (it has now been unpublished by the author, sorry) with the community members as I believe this business task is not unique:-) and many others should be interested in knowing how to properly handle this.
I am going to detail technical considerations of possible solutions at the application UI and database levels depending on various configurations of your data model including inheritance mapping options (Table per Hierarchy or Table per Type) and soft deletion.
Application UI level
First of all, let's start from the UI part. How would a developer of an XAF app ensure that its end-users are not allowed to save records whose property value or combination of values are unique?
As you know, XAF ships with a built-in validation module that provides a powerful and extendable validation engine and a large set of predefined attributes to configure common validation rules declaratively. To ensure uniqueness, you can first add the ValidationModule component into your XAF module or application via the designers and then choose from the two built-in rules: RuleCombinationOfPropertiesIsUnique and RuleUniqueValue (it is also possible to turn RuleObjectExists and RuleFromBoolPropert for the same task, but its use is not that straightforward use and I will not talk about it for now). Depending on your preferences, you can either annotate your data model classes with the corresponding code attributes, e.g.:
[RuleUniqueValue] public string Name { ... }
or declare everything at the Application Model level via the Model Editor tool (learn more...). In addition, you can configure the rule's CriteriaEvaluationBehavior parameter, to specify whether to look for modified objects that are currently loaded in memory, in addition to objects in the database itself.
As a result, the XAF's validation engine will consider the rules you configured when a data record is being saved (technically, when the View.ObjectSpace.Committing event is raised) and will throw ValidationException when uniqueness is violated. This is a special exception type, which is caught by other system controllers to display the validation error in a nice way in the UI:
This would be our topmost or basic protection level as it handles user input only. It will not help avoid duplicates if the same data records are created in code by a developer who did not call one of the Validator.RuleSet.ValidateXXX methods.