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

TcxDBDataController.FindRecordIndexByKey(Variant) Method

Finds the record which contains the specified key field values.

#Declaration

Delphi
function FindRecordIndexByKey(const AKeyFieldValues: Variant): Integer;

#Parameters

Name Type
AKeyFieldValues Variant

#Returns

Type
Integer

#Remarks

The FindRecordIndexByKey function searches for the record with the specified key field value(s) and returns its index. The AKeyFieldValues parameter specifies a variant or an array of variant values corresponding to the key field(s) set via the KeyFieldNames property.

If the record doesn’t exist or no key field names are assigned, FindRecordIndexByKey function returns -1.

The FindRecordIndexByKey method does not force the reloading of dataset data, since it searches the data controller’s internal buffer.

See Also