Ticket T695360
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Core - Design-time Model Editor does not take Entity Framework class metadata into account

Detailview layout set in model not match with the UI

created 6 years ago

Dear Support,
I found that the Detailview layout set in model not match with the UI.
Please check attached document for my setting.

Answers approved by DevExpress Support

created 6 years ago

Hello Horace,

DetailView layout items are generated based on the Layout node of the corresponding DetailView model. If certain items do not exist in the Application Model, they won't be added to the DetailView by default. If this happens, they either exist in the resulting Application Model, or are added at runtime through controls customization. I suggest that you research the issue as follows:

  1. Check this DetailView's Model at runtime. For example, you can create a ViewController and check the View.Model property in its OnActivated method.
  2. If the unwanted items do not exist in the Layout node, the corresponding controls are likely added at runtime in your or third-party code.
    3. If these items exist in the Layout node, check if they exist before user model settings are loaded. You can do this in the XafApplication.SetupComplete event handler. If the items do not exist there, this means that they were added to the Application Model at runtime and are stored in User Model Differences.
  3. If these items already exist in the SetupComplete event handler, check the application's XAFML files in the following order: Application.Web, Application.Module.Web, Application.Module. Find where these items are added or removed and ensure that these settings are not overridden in higher-level model files. Also, ensure that other settings from these XAFML files have effect on the application - with incorrect settings, an entire XAFML file can be ignored.

If this does not help, provide a sample project where the issue can be reproduced.

    Comments (3)

      Actually "SupplierEmailAddress" is the one that i added later after i constructed the layout of the detail view.  and it comes out automatically below the tabs.
      I have attached those module files for your to check.  I searched using "SupplierEmailAddress" in those module and i did only found the one that is in the tab but not under the tab.  there are no view controller manipulate those detailview also.
      Please support.

      Anatol (DevExpress) 6 years ago

        Hello Horace,

        Thank you for the additional information. I have managed to reproduce this issue. It occurs because the Remark and SupplierEmailAddress properties are decorated with the MaxLength attribute. At design time, they appear in the SimpleEditors group, but at runtime - in the SizeableEditors group. This happens because of specificities of collecting EF metadata in XAF. As a result, the runtime DetailView model has two layout items mapped to the same property - one item is created by you during layout customization, and another is generated automatically for the SizableEditors group. The easiest way to resolve the issue is to hide default-generated items by applying the VisibleInDetailView(false) attribute to these properties.
        I have also created a separate ticket to research this issue further: Core.EF - Large properties decorated with the MaxLength attribute cannot be hidden in the Model Editor.

        AG AG
        Alex Gn (DevExpress) 6 years ago

          With the version 18.2.6 we provided the capability to fix this issue on your side. Please refer to the Core - Design-time Model Editor does not take Entity Framework class metadata into account for more details.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.