From documentation:
In general, when you want to display child records in a separate control from the parent record,
you create multiple ProBindingSources. You bind one ProBindingSource to the parent table’s
navigation query and bind a different ProBindingSource to each child’s relation query, as shown
below:
rCustBindS = NEW Progress.Data.BindingSource(dshdl:TOP-NAV-QUERY(1)).
rCustGrid:DataSource = rCustBindS.
rOrderBindS = NEW Progress.Data.BindingSource(dshdl:GET-RELATION(1):QUERY).
rOrderGrid:DataSource = rOrderBindS.
rOlineBindS = NEW Progress.Data.BindingSource(dshdl:GET-RELATION(2):QUERY).
rOlineGrid:DataSource = rOlineBindS.
I tried that on two UltraGrid under OE10.2B06, the 1st UltraGrid connecting to it's own PBS with Handle property to <dataset>:TOP-NAV-QUERY(1) and the second having it's own PBS with Handle = <dataset>:GET-RELATION(1):QUERY, both PBS have AutoSync = TRUE.
The records show up correctly in the Parent UltraGrid, but the Child UltraGrid isn't refreshed when the selected record changes in the Parent UltraGrid.
The only way I got it to work is to subscribe to PositionChanged on the Parent PBS and to call <dataset>:GET-RELATION(1):QUERY:QUERY-OPEN()
The DataSet's parent-child relation defaults to "SELECTION" (no "REPOSITION" specified) so I presumed that:
"When navigating a filled ProDataSet object with a SELECTION relation, related data is filtered as it is browsed. This means the child query of the relation is filtered to make available only children of the current parent, and the query is re-opened each time the parent table is repositioned."
And a re-opening of the child Query should update it's PBS because its AutoSync = TRUE:
Reopening the query associated with the data source using either the QUERY-PREPARE and QUERY-OPEN methods or the OPEN QUERY statement. |
and