Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

Name Type
ARecordHandle TcxDataRecordHandle

#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