TcxCustomDataSource.InsertRecord(TcxDataRecordHandle) Method
Inserts a new record in a custom data source above a specific record.
Declaration
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.