Skip to main content

TcxCustomDataController.InsertRecord(Integer) Method

Inserts a new empty record in the current data controller.

Declaration

function InsertRecord(ARecordIndex: Integer): Integer; virtual;

Parameters

Name Type
ARecordIndex Integer

Returns

Type
Integer

Remarks

Use the InsertRecord method to insert a new empty record in the current data controller in unbound and provider modes. In bound mode, when the data controller (TcxDBDataController) provides dataset records, you should use the Insert method instead.

A new record is inserted at the position specified by the ARecordIndex parameter. InsertRecord returns the record index of the inserted record. The record index can be used to access field values of the record via the Values property.

In provider mode, you need to implement the AppendRecord and InsertRecord methods of your custom data source to allow record insertions. The AppendRecord method of your custom data source is automatically called when you insert a record in an empty data controller.

See Also