Skip to main content

TcxCustomGridTableController.TopRecordIndex Property

Addresses the topmost visible record within the current View.

Declaration

property TopRecordIndex: Integer read; write;

Property Value

Type
Integer

Remarks

You can use the TopRecordIndex property to scroll the View contents. TopRecordIndex specifies the index of the record displayed at the top of the visible View part. The index is relative to the first record within the View. TopRecordIndex allows you to scroll the View both in grid mode and in default mode.

In grid mode, only a fixed number of records is loaded into a memory buffer at a time. When scrolling, a grid control loads another portion of records into the buffer to reflect the current scroll location. In this mode, TopRecordIndex maintains a record index relative to the first record within the current buffer.

The Scroll method also enables you to scroll the View contents by simulating user actions with a scrollbar.

Table and Banded Table Views are capable of displaying vertical and horizontal scrollbars. To scroll vertically, use TopRecordIndex. To scroll horizontally, see the LeftPos property provided by the TcxGridTableController class. In Card Views, this property is not implemented; use TopRecordIndex instead.

The following example scrolls the View contents by 10 records forward.

with TcxCustomGridTableView(Grid.FocusedView).Controller do
    TopRecordIndex := TopRecordIndex + 10;
See Also