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

TcxCustomDataController.GetSelectedCount Method

Returns the number of selected rows.

#Declaration

Delphi
function GetSelectedCount: Integer;

#Returns

Type
Integer

#Remarks

This function returns the number of selected rows (data records and grouping rows) in the current data controller.

When the selection of multiple rows is disabled (the MultiSelect property is set to False), there can be only one selected row (equivalent to the focused row). In this mode, GetSelectedCount returns 1. However, you can call the SyncSelected method to unselect the focused row. In this case, GetSelectedCount returns 0.

GetSelectedCount can be used in all data loading modes (unbound, provider, bound, and grid modes). To access selected rows, you need to use the GetSelectedRowIndex method (in unbound/provider and default bound modes) or the GetSelectedBookmark function (in grid mode).

See Also