Search This Blog

Showing posts with label Model Editor. Show all posts
Showing posts with label Model Editor. Show all posts

Saturday, June 9, 2018

ATTENTION !!! This personal blog no longer gets new posts

Please follow the official XAF Team and XPO Team blogs, which are regularly updated by me and other DevExpress members.
Thanks, Dennis.

------------------------------------------
In XAF, users of the Model Editor and Report Designer tools are likely to be affected by this issue. Well, advanced users who enabled the ShowPropertyGrid property in the layout control or made custom PropertyGridControl integrations may be affected too - at least we all know a few😉

Our XtraVerticalGrid developers are aware of this problem and have already fixed it in v18.1.4 (it should be out in 1.5-2 weeks). In the meantime, the hotfix is already available for download at T638535: PropertyGridControl - The NullReferenceException is thrown when scrolling and an editor is active. Please accept sincerely apologies from our XAF, XtraReports and XtraVerticalGrid teams for all the inconvenience here.

Here is the error callstack for your reference:

System.NullReferenceException at DevExpress.XtraVerticalGrid.PGEditingState.MouseWheel(DevExpress.Utils.MouseWheelScrollClientArgs) at DevExpress.XtraVerticalGrid.BaseHandler.DevExpress.Utils.IMouseWheelScrollClient.OnMouseWheel(DevExpress.Utils.MouseWheelScrollClientArgs) at DevExpress.Utils.MouseWheelScrollHelper.OnScrollLine(DevExpress.Utils.DXMouseEventArgs, Int32, Boolean) at DevExpress.Utils.MouseWheelScrollHelper.OnMouseWheel(System.Windows.Forms.MouseEventArgs) at DevExpress.XtraVerticalGrid.BaseHandler.OnMouseWheel(System.Windows.Forms.MouseEventArgs) at DevExpress.XtraVerticalGrid.VGridControlBase.OnMouseWheelCore(System.Windows.Forms.MouseEventArgs) at DevExpress.XtraEditors.Container.EditorContainer.OnMouseWheel(System.Windows.Forms.MouseEventArgs) at System.Windows.Forms.Control.WmMouseWheel(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef) at DevExpress.XtraEditors.Container.EditorContainer.WndProc(System.Windows.Forms.Message ByRef) at DevExpress.XtraVerticalGrid.VGridControlBase.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)


Tip 1: The How to obtain a design-time exception call stack KB article describes how to locate these important error details, especially if your Visual Studio crashed. This information is helpful when submitting to support. BTW, to improve your chances of getting a faster and helpful answer from support, check these related tips as well:
   How do I ask a good question? (StackOverFlow)
   How to Report Bugs Effectively (Simon Tatham)
   A request for simple example programs (Julian Bucknall)
   Collect and Analyze the Diagnostic Information (XAF documentation)


Tip 2: When you located the call stack information and determined from it that an exception is raised from DevExpress code, I recommend you search for one or several topmost call stack method names in our support database. This behavior might be reported by someone else, e.g.: https://www.google.com/search?q=PGEditingState.MouseWheel


FreeImages.com

Wednesday, February 14, 2018

Customization Forms and Model Editor Improvements - XAF v17.2.6

Customizing Views layout, e.g., making certain fields visible, changing their locations is something that XAF developers usually learn and appreciate from day one. That is because you can drastically change the UI of your app by just moving the mouse and without any coding and recompilation, also at runtime. 

The next maintenance release (v17.2.6) should come with a few minor improvements to the customization forms in DetailView, ListView and the Model Editor, which we hope will be welcomed by both developers and end-users as well.


Monday, November 27, 2017

How to show Color Swatches for the Bezier skin and persist the user choice in XAF WinForms apps

If you are a fan of the new SVG Bezier skin, our WinForms components received in v17.2, do not miss the XAF integration on the subject:

https://www.devexpress.com/kb=T579152

Both theWinForms and XAF teams are looking forward to hearing from you on this new feature. Learn more about this major release from our What's New documents.


Thursday, October 19, 2017

How to group validation rules by a business type in Model Editor

If you want the same UI as in the screenshot below:


implement a few code lines in YourSolutionName.Module/Module.cs file, as follows:

using DevExpress.ExpressApp.ModelEditor;
using DevExpress.ExpressApp.Validation;
using DevExpress.ExpressApp.Model;

namespace MainDemo.Module {
    public sealed partial class MainDemoModule : ModuleBase {
        public MainDemoModule() {
            InitializeComponent();
            ModelEditorGroupingHelper.Instance.RegisterNodeGroupPathDelegate(
            typeof(IModelValidationRules), node => DefaultGroupPathCalculator("TargetType.Name", node));
        }
        public string[] DefaultGroupPathCalculator(string propertyName, IModelNode modelNode) {
            string groupName = "";
            object propertyValue = ModelEditorGroupingHelper.Instance.GetPropertyValue(propertyName, modelNode);
            if(propertyValue != null) {
                groupName = propertyValue.ToString();
            }
            return ModelEditorGroupingHelper.Instance.SplitGroupPath(groupName, modelNode);
        }
        //...
    }
}

This is just one example of the Model Editor nodes grouping customizations that you can achieve with the ModelEditorGroupingHelper  API.

I remember our loyal customer Mario Blataric doing magic using this helper for his specific project needs (multi-level grouping of Actions by Controllers and their namespaces/functional blocks). If you have similar needs in your project, feel free to contact our support team so we can help you make your life easier.

Friday, May 19, 2017

Questions on managing the Application Model settings in the database - YOUR FEEDBACK IS NEEDED!

We are reviewing usability of the mechanism responsible for storing and managing Application Model differences in the database (aka ModelDifferenceDbStore), and hence wanted to ask you to tell us about your practical experience with it.

In order to do this, please consider these questions:
1. Differences for which levels are you currently storing in the database and how well does this work for you (shared, user, or both)?

2. Have you required customizing differences stored in the database for already deployed production apps? If so, clarify the following points:
2.1. Was this customization done for shared or user levels?

2.2. List the exact use-case scenarios that needed such customizations (e.g., a client screwed up a View layout and could not reset it back to normal)?
2.3. Which solutions and how often did you use for this customization (e.g., direct database updates, editing raw XML after enabling the Administrative UI inside the app, etc.)?
2.4. How well did your current solutions for different customizations work for you so far and what could be improved in them and why?


3. Have you considered the opportunity to customize shared or user differences using the Standalone Model Editor, which visualizes the actual differences in XML content as a nodes tree? If so, clarify the following points to help us better understand the behavior you expect from such a feature:
3.1. Do you need to customize differences for shared, user or both levels?
3.2. Taking the severeness and effect of this operation over all application users, do you think that a logon form should be shown before someone can perform this customization for security reasons? Or, how do you plan to prevent a power user from obtaining the Standalone Model Editor tool binaries and running it locally for this or even harmful purposes?


We would greatly appreciate your answering these questions or providing any other information that would help us see how the current feature works for you and what can be improved further. 

Please provide answers here in comments or rather in the Support Center to track them easier: https://www.devexpress.com/support/center/question/create
Thanks in advance.


FreeImages.com/Ronit Geller

Friday, December 30, 2016

A WinForms example for collapsing/expanding layout groups and persisting their state


As you probably know, the New Web UI was recently enhanced with built-in options for this scenario. Today, I have updated the https://www.devexpress.com/kb=S135134 thread with a WinForms solution:


Please don't hesitate to write to us about each use case scenario that requires additional code to adjust the layout controls to better meet your business needs. My team and I will be more than happy to research them and see how to manage this situation better at the XAF or DevExpress component level. For instance, here we are thinking about providing platform-agnostic Application Model extensions for managing this task for Windows and the Web.

Wednesday, November 30, 2016

How long since you have seen the "Dictionary already contains ClassInfo ..." error for the Model Editor?

Old XAFers can remember this old sporadic issue caused by a Visual Studio bug that could not be fixed on the IDE side for years (learn more...). We were frustrated by it no less than our users, and this April (15.1.11+, 15.2.8+, 16.1+) we finally found a way to bypass this nasty behavior of an internal IDE assemblies cache on our side by changing the process of  loading assemblies at design time. This was quite a risky change, but so far our testing of many projects under various circumstances went well. We also have not received user reports on the original problem or other side effects with our designers since then (more than 8 months).



That said, I wanted to explicitly clarify with the XAF community whether it is really gone after our changes or not. Please leave a comment below on whether you have seen this error with the latest XAF versions OR you already cannot recall when it occurred last time. If this still bothers you, I would kindly ask you submit a ticket using the Support Center and attach a project where this behavior is stably reproducible, exactly as this kind guy did in the past.

My team and I look forward to hearing from you!

Thursday, October 13, 2016

How to map Actions to a certain RibbonPage and RibbonGroup via the Application Model

This is my second post about advanced ribbon menu customizations in XAF WinForms apps. This time I want to repost two possible solutions for the aforementioned task after reviewing and updating the code of one good (and never old - Hi, Noxe!:-)) customer recently. This work was done after an interview about my Simplifying customization of Action controls - YOUR FEEDBACK IS NEEDED! post. Take a look at it if you haven't yet. 


Long story short, refer to the https://www.devexpress.com/kb=S134617 ticket and find two possible Controller implementations. Even though the first one (RibbonFromModelWithEventController.cs) requires more code to implement, I like it more, because it does not require you to create an Action Container node manually in the Model Editor. With the first one, you just specify the TargetRibbonPage and TargetRibbonGroup properties for a required Action under the ActionDesign node and you are done:


In any case, I suggest you play with both implementations and watch the attached video to determine what is more suitable for you. I look forward to hearing from you in the comments section or in the Support Center, as always.


I do not want to focus much on the Controller code itself, just want to note that there we extended the standard IModelAction interface corresponding to the ActionDesign | Action node and then handled these new options in our code. This is one of my favorite Application Model features, which is also truly loved by our customers. In fact, everything you see in our framework is built using the same simple principle: you have certain UI metadata or settings store and have some Controllers in modules that create/customize visual controls accordingly. To learn more about this, refer to the Concepts > Application Model > Extend and Customize the Application Model in Code article in our online documentation. This is a really cool feature and it can help you create a more reusable code.

Wednesday, August 3, 2016

Usability improvements to the Model Editor layout designer and more in XAF v16.1.5

The recently released minor update brings several small, but useful features I hope you and your end-users will appreciate.

1. The layout designer available in the Model Editor at design time and runtime now generates a layout very close to what you can see in the end app. In particular, being invoked for the WinForms modules or apps, it now generates real Property Editors (in the disabled state and with fake data) instead of equivalent text boxes or bricks. It also tries to take into account and visualize the most popular layout and other options like ToolTip, ShowCaption, etc. IMHO, the most useful thing here is that you can now customize embedded ListView elements or List Property Editors corresponding to collection properties much easier via the grid control, like you can already do under the Views | ListView | Columns node. Even though the layout designer invoked for Web modules will not display real Web controls, but rather their corresponding WinForms analogs, the overall development experience will be better than before.




Monday, April 11, 2016

Disabling/enabling the Linked Nodes feature in the Model Editor (UPDATE for v15.2.9)

A while ago we conducted a survey on this feature and I want to share what we have done since then. Based on the user comments we received from the blog and other sources we decided to disable this feature by default, because it affected the Model Editor performance while being rarely used. Since there were also users who used from time to time, we also provided the capability to enable it via the button in the toolbar (available at both design and run time).




We hope that this behavior will meet the needs of the majority of our users and look forward to hearing from you in comments.

Tuesday, March 22, 2016

Web DetailView layout styling with the CustomCSSClassName attribute in the Model Editor

This small feature is available for the new XAF Web UI only, which is enabled by default in new projects starting from v15.2.7 and on. In short, the CustomCSSClassName attribute allows you to set a CSS class for a layout item or a group. Let's see how this works in practice.

For instance, to customize the color and size of the FullName view item, add the FullNameCSS CSS class in YourSolutionName.Web/Default.aspx file exactly as you would do this in a regular non-XAF ASP.NET application:
  
<!--...-->
<head runat="server">
    <title>Main Page</title>
    <meta http-equiv="Expires" content="0" />
    <style type="text/css">
        .FullNameCSS
        {
            font-size: 25px;
            color: darkblue;
        }
<!--...-->

Tuesday, March 15, 2016

Speeding the Model Editor up for large data models by disabling the Linked Nodes feature - YOUR FEEDBACK IS NEEDED!

We have recently received an inquiry from a customer who experienced low performance and intensive CPU utilization when opening the Model Editor for quite a complex project...Here I wanted to share a simple tip (+ short survey in the end!) that has helped that guy to improve the situation a lot in his particular project. To refresh your memory about 'Linked Nodes' (or Links as you see it in the Model Editor), let me quote our online documentation:

Certain nodes have a "virtual" child node named Links. Under this node, you can see nodes that contain references to the current node. The screenshot below illustrates the Department node of the IModelClass type. Within the Links node, you can see the Creatable Item for the Department object, Members of the Department type and Views designed for the Department type.



Our performance tuning tip is to disable this feature if you do not really use it or if it causes performance problems when the data model is really complex. Thus a lot of calculations are required to detect all dependencies aka linked nodes.

To apply this tip, set the static DevExpress.ExpressApp.Win.Core.ModelEditor.ExtendModelInterfaceAdapter.LinksEnabled property in the constructor of your WinForms ModuleBase descendant in the YourSolutionName.Module.Win/Module.xx file:

Monday, February 29, 2016

A simpler and more atomic control over associated collections using the AllowLink/AllowUnlink commands in the Model Editor

One of our recent team OKRs was and still is "improving developer experience when accomplishing common tasks", and in this blog post, I will cover yet another small, but important improvement in XAF v15.2.4+ that adds to this larger goal.

Let me quote Mark, the owner of the original suggestion in the Support Center, to quickly define the problem:

If you set AllowNew to false, both the link and new buttons are missing
If you set AllowDelete to false, both the delete and unlink buttons are missing.
There are scenarios where it would not be desirable to allow add new or add delete but to still have link and unlink (as those are very independent types of activities).
Proposed SolutionAllow for independent control of the link and unlink buttons.

As a side note, I wanted to note that we seem to have started exploring XAF with Mark almost at the same time in 2007. And from what I gather, he is still using our business application framework for his projects today in 2016, with 12 years of overall DevExpress experience in total! Who has more  "oscars"?;-)  - tell me your years with XAF/DevExpress in comments, please!

Back to the topic, previously there was a way to manage this using a custom ViewController (by managing the ActionBase.Active state), but this was not straightforward for most users. Since there were many other sensible scenarios from users where simplification for these popular commands would be required, we have implemented a simpler and more flexible solution at the Application Model level.

Now, in addition to the AllowNew, AllowEdit and AllowDelete quick options for the ListView node in the Model Editor, you can use the new 

Wednesday, February 24, 2016

Collapsible layout groups in the new XAF Web UI

Starting with v15.2, the new XAF web UI provides a built-in solution for this task. Please see a screenshot from our XCRM demo:



You can enable this feature for required layout groups in the Model Editor via the new IsCollapsibleCardGroup option at the Views | <DetailView> | Layout | level:

Friday, October 9, 2015

A minor improvement to the Object Property Editors that represent aggregated object references in the UI


Starting with version 15.1.8, you can easily specify a custom DetailView for ObjectPropertyEditor via the Model Editor at the DetailView | Items or ListView | Columns node levels in the Application Model:


Thus,  the IModelMemberViewItem.View  attribute now helps you specify custom Views for all object reference property editors used in both ListView and DetailView.

Previously, this task required a custom-tailored code solution like in the How to change ASPxObjectPropertyEditor's DetailView thread.  So, I hope you find this addition helpful.

Friday, October 2, 2015

Avoiding repetitive customizations for Views of the same type or subclasses via the Model Editor - YOUR FEEDBACK IS NEEDED

Prerequisites

Imagine you have the following data model classes:

class Party {...}

class Person : Party {...}
class Organization: Party {...}



XAF automatically generated several default root and nested Views for them in the Application Model. You can also create custom Views via the Model Editor on your own. For instance, you might end up with the following list under the Views node:


    Party_ListView
    Person_ListView1
    Person_ListViewN
    Organization_ListView1
    Organization_ListViewN



Scenario


Imagine your first goal is to customize the appearance of the ListView for the base class - Party_ListView according to your client needs.To accomplish this, you locate the Party_ListView node in the Model Editor and make various customizations to its columns. In particular, 1. edit captions for the Photo, Address1, Address2 columns; moved the Photo column after the Address1 and Address2 ones; 2. made changes to the ListView node properties such as set IsGroupPanelVisible, AllowEdit and other options in the property grid.


What if your second goal is to have a similar appearance for other ListViews where Party records are shown, e.g., Person_ListView, Organization_ListView1, Party_LookupListView or even Company_Persons_ListView (see the poll questions in the end)?


Thursday, July 23, 2015

Usability improvements to the Localization Tool in the Model Editor (v15.1.6)

Take special note of a small improvement we have added into the next minor update (15.1.6) based on the real customer story, which we greatly appreciate. So, if you are developing multilingual apps and have to localize them using the Localization Tool, check out the 
T266560: Localization Tool - Usability improvements thread in the Support Center for details. In short:


We have extended the Export command with a new item allowing you to export all the records. This is now the default choice, in addition to the other option of exporting the currently selected record only. 

We also provided a separate Save button in this dialog to make saving translated items more atomic.



Do not hesitate to address such things to our team, because this will make your everyday work easier. Adding a keyboard shortcut, changing the default item choice and other minor things are often not difficult to implement (e.g., this one took about 2 hours with tests), but they will greatly improve your overall experience with the product, which is also true for other XAF peers.

Happy XAFing and thanks for all your feedback!

Wednesday, April 1, 2015

Minor improvement to the Model Editor with regard to the selection of default Views for a type or editor in v14.2.7

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.

In v14.2.7, you can select a View designed for the base business class from the combo box when editing the following properties in the Model Editor:

    IModelClass.DefaultListView
    IModelClass.DefaultDetailView
    IModelClass.DefaultLookupListView
    IModelListView.MasterDetailView
    IModelListView.DetailView
    IModelMemberViewItem.View

The list displayed in the compo box is sorted according to the inheritance hierarchy:


UPDATE:
This improvement was added in v14.2.7 based on the requests from our users.

Thursday, January 8, 2015

Model.XAFML and storing XAF application UI settings in the database

As we are improving our newest "Persisting UI settings in the database" feature (quickly learn more about it from this video or blog), I wanted to pay your attention to the ModelDifferenceDbStore - Always take into account the latest changes made to the Model.XAFML file at design time ticket I created based on the users feedback. Let me quote myself from that thread:
Prerequisites

By default, starting with v14.2, all new XAF WinForms projects will store administrative (Model.XAFML) and user differences in the database tables (ModelDifference and ModelDifferenceAspect). 

This built-in option stems from the How to: Store Model Differences in Database example we had in the past.
This new behavior is plugged-in if the Security System is enabled in the Solution Wizard and is technically done by subscribing to the CreateCustomModelDifferenceStore and CreateCustomUserModelDifferenceStore events within YourSolutionName.Module.Win/Module.xx file. Refer to the eXpressApp Framework > Task-Based Help > How to: Store the Application Model Differences in the Database article for more details.

Problem description
As of v14.2.3, the contents of the Model.XAFML file are once read during the first application run and are stored in the database. Thus, any subsequent changes to the Model.XAFML file during development will not be re-read into the database or ignored. This feature request is for improving the developers' experience when this feature is in use.

Current solutions
Take special note that to start reading subsequent customizations from the Model.XAFML file at every application run as it was in the past, you will need to backup and then drop the existing ModelDifference and ModelDifferenceAspect tables in  your test database on your development machine.

Tuesday, December 23, 2014

A small usability improvement to the new visual ListView designer available in v14.2

Thanks to our great customers and their feedback in this Support Center ticket we could make our recent addition to the Model Editor yet better. Starting with version 14.2.4, it will be much more convenient to view and configure ListView with lots of columns, because now the horizontal scrollbar will be displayed in this situation. A picture is worth a thousand words:


Of course, the live preview will also respect column sizes set in the property grid for each IModelColumn object.