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

TcxCustomGridTableController.TopRecordIndex Property

Addresses the topmost visible record within the current View.

#Declaration

Delphi
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