Try OpenEdge Now
skip to main content
GUI for .NET Programming
Binding ABL Data to .NET Controls : Managing data updates : Synchronizing data : Reopening queries
Reopening queries
If the AutoSync property is TRUE, using the OPEN QUERY statement or the QUERY-OPEN( ) method to reopen the query for a bound ABL data source object automatically synchronizes any bound UI control. Each control's design determines how that control responds to this synchronization. For example, synchronizing the screen values in a grid does not usually reset the current position of the cursor which would produce a change in the ProBindingSource's Position property.
Note: This automatic synchronization does not occur if the query is reopened within the context of an OffEnd event handler.
When you bind to a ProDataSet, the ProDataSet buffer's AUTO-SYNCHRONIZE attribute affects the synchronization behavior. By default, this attribute is FALSE. So, the AVM does not automatically synchronize all the ProDataSet's relation queries when one of them is positioned to a different row. Automatic synchronization might incur unnecessary overhead and slow your application.
However, if the attribute is TRUE for a specific buffer, the AVM automatically reopens any child query when your application navigates to a new parent record in a ProDataSet. When the ProBindingSource's AutoSync property is TRUE, this behavior leads to the automatic synchronization of any UI control bound to the child query. For more information about how to synchronize ProDataSets, see the chapter on attributes and methods in OpenEdge Development: ProDataSets.
If the ProDataSet buffer's AUTO-SYNCHRONIZE attribute is FALSE, you can synchronize the data by capturing the ProBindingSource's PositionChanged event and calling the ProDataSet's SYNCHRONIZE( ) method.
Caution: Your application should not reopen a query while a user is editing a record. This might cause UI errors or other incorrect results.