I have a Dataset with tables Patient, Visit and Document. Patient is the parent of Visit with relation FK_Patient_Visit. Visit is the parent of Document with relation FK_Visit_Document.
Using BindingSources, XtraGrid1 is bound to Dataset.Patient, and XtraGrid2 is bound to FK_Patient_Visit.
XtraGrid2 displays Visits correctly based on the selected Patient. It also displays Documents correctly (as a detail of Visits), as long as ShowOnlyPredefinedDetails = false.
When I set ShowOnlyPredefinedDetails = true and try to Retrieve Fields, the detail GridView is not created and I am unsure how to bind the detail view manually. I have tried to create a second level GridView and set a column's field to, for example, fKPatientVisitBindingSource.DocumentType, but no matter what I do the child GridView is never displayed.
Can you tell me what I should do?
Thanks.
Hi,
Thank you for your message.
I have created a small sample based upon your description, and it operates as expected here. That is, I have a DataSet with three tables: CustomerInfo, Detail, and DetailInfo. The CustomerInfo table has a one-to-many relationship with the Detail table. In its turn, the Detail table has a one-to-many relationship with the DetailInfo one. I have created two BindingSource components. The first one's DataSource property is set to DataSet and the DataMember property - to "CustomerInfo". The second BindingSource is bound to the first BindingSource, and its DataMember property is set to the relationship name ("CustomerInfo_Detail"). A grid is bound to the second BindingSource. This way, if I click the Retrieve Details button, a corresponding detail level is created.
I have attached this sample here, so that you can look at it. You can delete a detail level there and click the Retrieve Fields button to see the result.
In addition, I recommend that you review the Level Designer help article to learn how to create detail levels based upon relationships.
If the issue is not resolved, please modify my sample to show it. We will do our best to provide you with the best support.
I am looking forward to your response.
Thank you for the example. Although it did not exactly mimic my situation - I have two grids, with three levels - it provided enough information for me to solve my problem. It had been a while since I worked with WinForms controls, so the Level Designer refresher was a good suggestion.
The issue is resolved.
Hi,
Thank you for informing us that the issue has been resolved. Please do not hesitate to contact us in case of any difficulty. We will be happy to help you! :)