[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TListItems.ClearSelection

Clears the selected state for all TListItem instances in the container.

## Declaration

Source position: comctrls.pp line 1163

`protected procedure TListItems.ClearSelection;`

## Description

ClearSelection iterates over the values in Item and updates a TListItem instance when its State flags include the value lisSelected. The lisSelected flag value is removed from the internal member for the TListItem instance(s). The OnSelectItem event handler for the list view control is signalled (when assigned) for each of the Item instances updated in the method.

Use SelectAll to select all of the list items in the container.

## See also

TListItems.Item |  | Provides indexed access to the TListItem instance in the container by their ordinal position.
TListItems.SelectAll |  | Sets the selected state to True for all TListItem instances in the container.
TListItem.Selected |  | Whether this Item has been Selected (often denoted by a check-mark).
TCustomListView.OnSelectItem |  | Event handler signalled when the selected list item for the control is changed.