Special case: unbound class instance
- Last Updated: June 18, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Special case: unbound class instance
If you invoke the Progress.Data.BindingSource constructor without supplying any parameters, you create an unbound class instance. At run time, you can bind the ProBindingSource instance to an ABL data source object by setting the Handle property to the data object's handle.
The ProBindingSource follows
its default behavior for binding to the specified data object. The
ProBindingSource makes all fields in the data object available to
the UI control. In the case of a ProDataSet, it binds to the first
top-level buffer in the ProDataSet. If you do not want to make all
fields available, you can use the ProBindingSource's SetFields( ) method
to choose which fields are exposed to the .NET controls.
The SetFields( ) method
uses the same parameters as the ProBindingSource constructors. The
first parameter is an include-fields list. The
second parameter is an except-fields list. The
final parameter depends on the type of data source object to which
the ProBindingSource will bind:
- For a ProDataSet, the final parameter is either the parent-buffer-name or parent-buffer-hdl.
- For any other data source, the final parameter must be an empty string, "".
SetFields( ) method before
you specify the Handle property. If you use the SetFields( ) method
after binding to a data source object, the ProBindingSource throws
a .NET exception.The following code fragment shows the correct sequence for using this method: