ive downloaded the demo, and also examples and looked at the docs but i cant find a step by step of setting up a typical master details scenario via bindingsource within a windows forms project.
heres what ive done:
- generated my classes using the selfservice model
- added my collections to the toolbox
- drag Master DGV onto the form and a bindingsource and my master entitycollection
- hook up DGV to bindingsource, and bindingsource to entitycollection. All looks good and grid shows all columns
- repeat for my details grid, except that the details bindingsource data source is the master
bindingsource, with appropriate datamember property set
- code behind as follows:
-
form_load:
masterCollection1.GetMulti(nothing)
masterCollectionBindingSource.DataSource = masterCollection1
detailCollectionBindingSource.DataSource = masterCollectionBindingSource
detailCollectionBindingSource.DataMember = "qualpeople"
-
masterBindingSource_CurrentChanged:
If masterCollectionBindingSource.Position > -1 Then
Dim m As masterEntity = CType(masterCollectionBindingSource.Current, masterEntity)
detailCollection1.GetMultiManyToOne(Nothing, Nothing, m)
End If
The detail grid is correctly poulated on initial load, but as soon as the master grid selection changes the detail grid clears and is not refilled. SQL Query profiler shows the correct queries running against the server but they are not showing in the grid
Im sure Im missing something pretty basic here?!
thanks