Spread 8.0 Documentation
DataField Property
Support Options
ActiveX Reference > ActiveX Properties > DataField Property

Glossary Item Box

DataField Property


See Also    Example

Applies To

fpSpread control

Description

Sets or returns the database field name assigned to a column in a bound sheet. This property is available at run time only.

Syntax

C++

CString CSpreadSheet::GetDataField( );
void CSpreadSheet::SetDataField(LPCTSTR value);

Visual Basic

[form.]fpSpread.DataField[ = text$]

Remarks

The DataField property is valid only when the sheet is bound to a database.

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property. Set the Col property to specify the column that will contain the data from the data field before setting the DataField property.

If you do not assign field names to columns in the sheet, by default the sheet reads in all the fields from the database. However, if you assign field names to specific columns, the sheet only reads in those fields from the database. Note that you do not have to assign field names to contiguous columns. For more information about assigning database fields to columns, see Displaying Selected Fields in Columns.

Specify the Data control to which to connect the sheet using the DataSource property.

Visual Basic users can refer to the Visual Basic documentation for additional information about this property.

Spread Designer

Choose the Sheet menu, and then the Data Binding menu, and then select the name in the Database Column (DataField) drop-down list box and use the Set Data Field and Clear Data Field buttons in the Selected Column Data Binding Information group box in the Data Binding Settings dialog box.

Select the column that will read the database field before selecting the field from the Database Column drop-down list box. Once you have selected the field, press the Set Data Field button. If you want to clear the field, select the Clear Data Field button.

Data Type

String

See Also

Displaying Selected Fields in Columns

Col, DataFillEvent, DataSource, DAutoFill properties

Copyright © GrapeCity, inc. All rights reserved.