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
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
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
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.
Hello, Chris.
I'm afraid it is unclear how you what to show data. Would you please provide an image illustrating your requirements?
Hi Michael,
I would like to display data in XAF application on lists using "Master-Detail Relationship". I have tried Anthony's code from ticket T427594. But it does not work for me. I have a simple one-to-one relationship can I use such behavior? Could you please point me in the right direction.
Thanks,
Chris
Hello,
In the initial post, you wrote 'many-to-many related components' while in the last - 'I have a simple one-to-one relationship', so your data structure is not clear. The desired result also is not clear. Would you please provide us with a simple example that illustrates your data structure and a simple sketch that illustrates what appearance you wish to get? This way we will be able to provide you with the most precise solution. A request for simple example programs
Thanks,
Andrey
Hi, Please find the attached code. For example, WaterPipe on list view should not display attributes from AddressData, ConstructionData, InsulationData, WaterNodeEdgeConnectivity, but fields from them should be able to display after the row is expanded using plus sign using Master-Detail Relationship. Could you be able to help me?
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.
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
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.