piBindingTable - cCJGridColumn

Along with piBindingColumn, determines which database table the grid column is bound to

Type: Property

Access: Read/Write

Data Type: Integer

Parameters: None

Syntax
 Property Integer piBindingTable

Read Access: Get piBindingTable to IntegerVariable
Write Access: Set piBindingTable to IntegerVariable/Value


Description

The binding properties, piBindingTable and piBindingColumn, determine which database table and column (file.field) the grid column object is bound to. This information is used by the column object to communicate with the data dictionary objects. This is used to:

1. Set up DD information about the column such as data type, masking, prompt objects, etc.
2. Provide DD-based entering, exiting and validation logic.
3. Move data between the database and the grid's datasource.

Although these properties are defined in the cCJGridColumn class, only the cDbCJGridColumn subclass uses them.

Normally, both binding properties are set together, using the Entry_Item command:

Entry_Item  Customer.Name

The above code converts the Customer.Name into a table number and column number and then sets piBindingTable and piBindingColumn. It is expected that this binding information is static and set one time before the grid is activated.

You can use the binding properties along with the grid's Server property to communicate with your data dictionaries.

Procedure ShowColumnInfo
    String sLabel sValue
    Integer iTable iColumn
    Handle hoServer

    Get Server to hoServer
    Get BindingTable to iTable
    If (iTable<>0) Begin
        Get piBindingColumn to iColumn
        Get File_Field_Label of hoServer iFile iField DD_LABEL_SHORT to sLabel
        Get SelectedRowValue to sValue
        Showln "Label=" sLabel "    Value= " sValue
    End
End_Procedure

If piBindingTable is 0, it indicates that the column is not bound to a table and that the column's value is being manually maintained. This is often done with custom code inside of the OnSetCalculatedValue event.