Previous Next

SetFields( ) method

(Windows only; GUI for .NET only)
Specifies which columns are bound to a ProBindingSource instance, exposing them for bound .NET controls. You use these method overloads before you bind a data source object to a previously unbound ProBindingSource instance.
Note:
Return type:
Access:
Applies to:
 
Syntax 
BindingSource:SetFields ( INPUT include-fields     AS CHARACTER ,
                          INPUT except-fields      AS CHARACTER ,
                      {   "" 
                        | INPUT parent-buffer-hdl  AS HANDLE 
                        | INPUT parent-buffer-name AS CHARACTER   } )
include-fields
A CHARACTER expression that evaluates to a comma-separated list of fields in the ABL data source object to bind to the ProBindingSource. To include all fields, specify an asterisk (*) in include-fields. To include all but a few fields, specify an asterisk (*) in include-fields and a comma-separated list of fields to exclude in except-fields. If include-fields contains specific fields, except-fields is ignored.
When including fields for a ProDataSet object, you must specify a comma-separated list of fields to display in display order and qualify the field names with their buffer name. For example:
 
"table1.field1,table1.field2,table2.field1,table1.field3"
You must specify at least one field from each table in the hierarchy to be displayed.
When including fields for a query or a join query, you must specify a comma-separated list of fields to display in display order and you should qualify ambiguous field names with their buffer name.
Do not specify a RAW temp-table or database field in include-fields. If you explicitly specify a RAW field, the AVM generates a run-time error. If you specify an asterisk (“*”) to include all fields and there is a RAW field in the table, the AVM excludes it automatically even if it is not specified in except-fields.
except-fields
A CHARACTER expression that evaluates to a comma-separated list of fields in the ABL data source object to exclude from binding to the ProBindingSource. You can specify fields to exclude only when include-fields contains an asterisk (*). If you do not have any fields to exclude, you must specify the empty string (""). If include-fields contains specific fields, except-fields is ignored.
parent-buffer-name
A CHARACTER variable that represents the name of a parent buffer in a ProDataSet object. This corresponds to the top-level table displayed in a hierarchical control (such as a grid or a treeview). If the data source object is not a ProDataSet, this parameter must be the empty string (""). If you specify a name and then bind to another type of data source object, the ProBindingSource throws a .NET exception.
parent-buffer-hdl
A HANDLE variable that represents the handle to a parent buffer in a ProDataSet object. This corresponds to the top-level table displayed in a hierarchical control (such as a grid or a treeview). If the data source object is not a ProDataSet, this parameter must be the empty string (""). If you specify a handle and then bind to another type of data source object, the ProBindingSource throws a .NET exception.
The following code fragment shows the correct sequence for using this method:
1.
2.
3.
 
DEFINE VARIABLE pbs AS Progress.Data.BindingSource NO-UNDO.
 
/* 1 */
pbs = NEW Progress.Data.BindingSource().
 
/* 2 */
pbs:SetFields("Customer.CustNum,Customer.Name,Customer.State","","").
 
/* 3 */
pbs:Handle = myQryHdl.
See also:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.