Ticket T622001
Visible to All Users

Master detail view on detail view for related components

created 7 years ago

Hi,

Is there a way to display master-detail view for many-to-many related components that are currently displayed on tabs to in detail view.not on the list view.

Thanks,
Chris

Show previous comments (4)
DevExpress Support Team 7 years ago

    Thank you for the update. Although it is still not quite clear what data representation you mean, I suppose solutions described in the following ticket will help you: Grid List Editors - How do I show both master and detail records in the same grid control (aka master-detail). If this doesn't help, please describe your requirements in greater detail.

    KJ KJ
    Krzysztof Jankowski 7 years ago

      Hi Micheal,

      I think I mix the context.  Could you please let me know what settings in the model or in code over to achieve master-detail view in list view. Please see the link

      Thanks,
      Chris

      DevExpress Support Team 7 years ago

        Hi Chris,

        I am afraid that we do not have an immediate answer and need more time to find an appropriate solution. Please bear with us. We will get back to you as soon as possible.

        Answers approved by DevExpress Support

        created 7 years ago (modified 7 years ago)

        Hello,

        Thank you for your patience. To enable master details in a XAF WinForms application, access the grid control as shown in the Access Grid Control Properties article and set its GridOptionsView.ShowDetailButtons and GridOptionsView.ShowDetailButtons properties to true.
        To prevent infinite master detail (parents show their children, then children show their parents and so on), additionally set the GridControl.ShowOnlyPredefinedDetails property to true and create details in the following manner:

        C#
        private void CustomWinController_ViewControlsCreated(object sender, EventArgs e) { GridListEditor listEditor = ((ListView)View).Editor as GridListEditor; if(listEditor != null) { GridView gridView = listEditor.GridView; listEditor.Grid.ShowOnlyPredefinedDetails = true; BaseView ordersView = listEditor.Grid.CreateView("GridView"); listEditor.Grid.LevelTree.Nodes.Add("Tasks", ordersView); gridView.OptionsDetail.EnableMasterViewMode = true; gridView.OptionsView.ShowDetailButtons = true; } }

        Try this approach and let us know your results.

        Thanks,
        Andre

          Comments (1)
          Andrey K (DevExpress Support) 7 years ago

            Hello,

            To prevent infinite master detail (parents show their children, then children show their parents and so on), additionally set the GridControl.ShowOnlyPredefinedDetails property to true and create details in the following manner:

            C#
            private void CustomWinController_ViewControlsCreated(object sender, EventArgs e) { GridListEditor listEditor = ((ListView)View).Editor as GridListEditor; if(listEditor != null) { GridView gridView = listEditor.GridView; listEditor.Grid.ShowOnlyPredefinedDetails = true; BaseView ordersView = listEditor.Grid.CreateView("GridView"); listEditor.Grid.LevelTree.Nodes.Add("Tasks", ordersView); gridView.OptionsDetail.EnableMasterViewMode = true; gridView.OptionsView.ShowDetailButtons = true; } }

            I modified my answer accordingly and added a simple example that illustrates this approach in action.

            Do not hesitate to contact us in case you face any difficulties.

            Thanks,
            Andrey

            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.