Back to Devexpress

TcxCustomDataSource.InsertRecord(TcxDataRecordHandle) Method

vcl-cxcustomdata-dot-tcxcustomdatasource-dot-insertrecord-x28-cxcustomdata-dot-tcxdatarecordhandle-x29.md

latest2.1 KB
Original Source

TcxCustomDataSource.InsertRecord(TcxDataRecordHandle) Method

Inserts a new record in a custom data source above a specific record.

Declaration

delphi
function InsertRecord(ARecordHandle: TcxDataRecordHandle): TcxDataRecordHandle; virtual;

Parameters

NameType
ARecordHandleTcxDataRecordHandle

Returns

Type
TcxDataRecordHandle

Remarks

This function is called when a user inserts a new record within the current custom data source, for instance, by using the data controller’s InsertRecord function.

In a grid control, records are inserted in a view when the end-user presses the INS key. This functionality is enabled if the view’s OptionsData.Inserting property is set to True. Otherwise, pressing the INS key performs no action.

When implementing the InsertRecord function, you should insert a new empty record within your custom data source and then call the DataChanged method. You should also return the handle of the new record (a unique value which will be used later as this record’s identifier).

The ARecordHandle parameter specifies the handle of the record above which a new record should be inserted. See the TcxCustomDataSource class description for information on record handles.

See Also

TcxCustomDataSource.AppendRecord

TcxCustomDataSource.DeleteRecord

Example: TcxCustomDataSource.AppendRecord, TcxCustomDataSource.InsertRecord

TcxCustomDataSource Class

TcxCustomDataSource Members

cxCustomData Unit