Try OpenEdge Now
skip to main content
GUI for .NET Programming
Notes on using the ProBindingSource : Determining what to bind to the ProBindingSource
 

Determining what to bind to the ProBindingSource

If the control(s) bound to a ProBindingSource will show only data from a single query (single table or single join query), the ProBindingSource should be bound to that query. If the control(s) bound to a ProBindingSource need to show hierarchical data (for example, customers and their orders), the ProBindingSource should be bound to a ProDataSet.
While it is possible to bind to a ProDataSet if you want to see only the data from the top-level table, doing so is inefficient. Internally, objects are created on the .NET side for each level in the ProDataSet's hierarchy. These .NET objects act as the conduit between the control and the underlying ABL data source— the temp-table. When the binding is initiated, each of these .NET objects has to communicate back to the AVM to acquire the schema associated with that level of the hierarchy. Clearly, if you are interested in only one level of data, the extra expenditure of time and resources related to acquiring the schema associated with all levels is unnecessary.
If you already have a ProDataSet, you do not need to create new queries to bind to if you are only interested in one level: You can bind to the queries already associated with the ProDataSet. For example, if you want to see the data from the top-level table, execute the following statement:
myBindingSource:Handle = myDataSet:TOP-NAV-QUERY.
If you have a control that shows data only from a child table, execute the following statement:
myBindingSource:Handle = myDataSet:GET-RELATION(n):QUERY.
In this case, n represents the level of data in which you are interested.