Skip to main content

TcxCustomDataController.FocusedRecordIndex Property

Specifies the record index of the record with the current focus.

Declaration

property FocusedRecordIndex: Integer read; write;

Property Value

Type
Integer

Remarks

This property specifies the record index of the focused record. By changing the FocusedRecordIndex property, you can set focus to another data record.

If you need to focus a record at a particular position determined by its row index, use the FocusedRowIndex property. This property enables you to focus data records and grouping rows that are visible or potentially visible by scrolling (for instance, using ExpressQuantumGrid). Records hidden within collapsed data groups are not assigned row indexes and therefore cannot be focused via the FocusedRowIndex property.

Refer to the TcxCustomDataController class description for information on record and row indexes.

When synchronization between a grid control and a dataset is enabled (in bound mode implemented by the TcxDBDataController class), the focused record corresponds to the current/active record in TDataSet. In this case, dataset navigation by the TDataSet.First, TDataSet.Last, TDataSet.Next, TDataSet.Prior and TDataSet.MoveBy methods changes the focused record position. Synchronization between a grid control and a dataset is enabled if any of the following conditions are met:

  • The grid control is in grid mode, when only a fixed number of records are loaded into the memory buffer at a time. When scrolling causes a different set of records to be loaded into the buffer, the focused record automatically changes to address a record within this buffer. In this mode, the FocusedRecordIndex property stores a record index relative to the first record of the current record set loaded into the buffer;

  • The DataController.DataModeController.SyncMode property is set to True.

See Also