CURRENT-QUERY( ) method
The handle to the ProDataSet query that contains the currently selected row in the ProBindingSource. This method enables access to the correct child query when a bound .NET grid edits, creates, or deletes a row from a child table.
Use this method when the .NET control is bound to a ProDataSet object that contains child buffers.
Data type: HANDLE
Access: Readable
Applies to: Data-relation object handle
band-index
When a .NET control binds to a ProBindingSource that uses a ProDataSet as its data source object, multiple relations for the same parent-child relationship might be presented to the user simultaneously. When the user first expands a parent row in the bound .NET control, the ProBindingSource creates a new child query and displays all child rows for that parent row. The ProBindingSource uses the ProDataSet object’s data-relation query to create and maintain this unique query for all child rows related to the expanded parent row.
Note: You cannot set this query handle or modify the query.The following code fragment shows an event handler. The event handler accepts information from a bound UltraWinGrid displaying Order and Orderline data through the grid’s extended version of the .NET System.EventArgs class. From that information, the event handler can find the correct query for the currently selected record.
When a ProBindingSource is attached to a ProDataSet with a recursive data-relation, the code above does not work because a single buffer is associated with multiple BandIndexes in a hierarchical grid. The event handler must specify the BandIndex of the current row to determine the correct query.
The following example shows a similar event handler using the optional parameter. Because an employee might also be a manager and have employees of his own, dsRecursive has a recursive data-relation between EmpName and Manager. For the top band of the hierarchy, the event handler can use the TOP-NAV-QUERY. For lower bands, it needs the optional parameter to determine the correct query.
See also: BandIndex property
OpenEdge Release 10.2B
|