DataField Property

Gets or sets the name of a field within a data source to be displayed in this object.

object.DataField = [string]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the name of the field to bind to.

Client support

   Newlook Smartclient

   Newlook Server

Use

Combo box, Date combo, Label, Numeric combo and Text box controls

For the Combo box, Date combo, Label, Numeric combo and Text box controls, this property specifies the field to display in the control for the current record.

It is only relevant for controls that are bound to an external data source via a data control. The Data Control creates a connection between inserted controls on your form and an external data source.

Once a connection to the database is established (via the ConnectionString property of the Data control) then any control that is bound to that Data control will automatically display data for the current record.

The Data control performs operations on the current record and updates all controls bound to it.

The most common data source that a data control is connected to is a database table. In this example, the DataField represents an individual column of data within a table.

The DataSource property is used to bind an inserted control to an existing data control on your form.

The DataField property then links the control to a specific field in the data source.

TIP:

Field names are often case-sensitive. For example, OS/400 DDM databases field names require all uppercase letters.

BE AWARE THAT:

If the control is bound to a data source via the DataField and DataSource properties then any value specified in the Text property at Design-time will be ignored.

Datagrid control

This property is only relevant when a datagrid is bound to an external data source (via the ConnectionString, Server and Source properties of the datagrid).

When used in the data grid column, this property is read-only at run-time and reflects the field that the column's data originates from.

See Also

Data control | DataSource property | ConnectionString property | Server property | Source property

Applies To

Combo box control

Data grid Column object

Date combo box control

Label control

Numeric combo control

Text box control


© 2004-2021 looksoftware. All rights reserved.