Try OpenEdge Now
skip to main content
GUI for .NET Primer
Data Binding : Defining ProBindingSource tables and fields

Defining ProBindingSource tables and fields

Bound .NET controls have no direct understanding of the bound ABL data source objects. The .NET controls cannot access the schema of a bound ABL data source object to find the default format, the validation phrase, or the help text for a field. The .NET controls can only access what the binding interfaces in the Progress.Data.BindingSource class make available.
The task of binding a data source to the ProBindingSource control includes the identification of data source tables and fields that will be exposed to the bound .NET control. Since the data source is provided at run time, the binding source may provide a design-time schema that matches the schema used at run time. So, how is the schema supplied to the binding source? The ProBindingSource Designer tool, available in the Visual Designer's Design view, is used to define what data source tables and fields are available to be bound to a control. Schema information can either be entered manually or imported from an XML Schema file. Similar to an OpenEdge Data Definition file (.df), in this context an XML Schema file defines table name, field name, field data type, field display format, field label, and so on as XML data.
You can create an XML Schema file containing the definition of a ProDataSet, a temp-table, or a temp-table buffer object using the ABL WRITE-XMLSCHEMA( ) method. This method uses the industry-standard XML Schema Definition (XSD) language. The XML Schema file that is produced may contain more fields than you need. After importing an XML Schema file, you can eliminate unwanted fields in the ProBindingSource control by removing them with the ProBindingSource Designer. Alternately, you can allow the ProBindingSource to contain all the data source fields, so it can be reused and bound to a number of controls.