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.GetSelectedBookmark(Integer) Method

Returns a bookmark for a particular selected record when the data controller is in grid mode.

#Declaration

Delphi
function GetSelectedBookmark(Index: Integer): TcxBookmark;

#Parameters

Name Type
Index Integer

#Returns

Type
TcxBookmark

#Remarks

Use the GetSelectedBookmark function to access selected records when grid mode is applied.

In grid mode, the data controller automatically creates bookmarks once you select records via the ChangeRowSelection, SelectAll or SelectRows methods. You can retrieve those bookmarks using the GetSelectedBookmark function. The Index parameter addresses the selected record by its position within the collection of selected records. Index can vary from 0 to GetSelectedCount - 1.

A bookmark is an object marking a particular dataset record. This can be used to jump to this record later via the dataset’s Bookmark property. Assigning a bookmark to the TDataSet.Bookmark property changes the current dataset record.

To iterate selected rows (data records and grouping rows) in provider, unbound and default bound modes, use the GetSelectedRowIndex method instead.

To iterate selected rows, you can also use the ForEachRow method. This can be applied in all loading modes.

A bookmark created by the SaveBookmark method does not affect bookmarks for selected records and vice versa. Bookmarks accessible via the GetSelectedBookmark function are created automatically, which enables you to iterate through selected records. The SaveBookmark method allows you to mark a position in the data controller and then jump to it using the GotoBookmark method.

See Also