Skip to main content

TcxCustomDataController.SyncSelected(Boolean) Method

Allows you to select/unselect the focused row when multiple row selection is disabled.

Declaration

procedure SyncSelected(ASelected: Boolean);

Parameters

Name Type
ASelected Boolean

Remarks

The SyncSelected method is in effect only when multiple row selection is disabled, i.e. when the MultiSelect property is set to False.

This method selects/unselects the focused record based on the ASelected parameter value.

By default, when multiple record selection is disabled, the focused and selected rows are equivalent and the GetSelectedCount function returns 1.

Calling the SyncSelected function set to False as the ASelected parameter unselects the focused row and GetSelectedCount returns 0. Note that after you have moved focus to another row, it becomes selected again.

Calling the SyncSelected method with the ASelected parameter set to True restores the selection state of the focused row after it was cleared by using SyncSelected(False).

When data from the data controller is represented by a control (ExpressQuantumGrid, for instance), selected rows are painted in a different color so that they can be distinguished from regular records. Unselecting the focused row clears highlighting and so it looks like no rows are selected. Also, in this case, you are unable to access the selected record via the GetSelectedRowIndex or the GetSelectedBookmark function.

See Also