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

# TCustomListView.MultiSelect

Allows simultaneous selection of one or more list items using Ctrl+Click, Shift+Click, Ctrl+Shift+Click, or using program code.

## Declaration

Source position: comctrls.pp line 1679

`public property TCustomListView.MultiSelect : Boolean index Ord(lvpMultiselect) read GetProperty write SetProperty default False;`

## Description

MultiSelect is a Boolean property which indicates if multiple simultaneous item selections are allows in the list view control. The default value for the property is False, and allows a single selection as reflected in the Selected property.

When set to True, multiple entries in the Items property can be marked as Selected. This can be achieved in program code by iterating over the TListItem instances in Items, and setting the Selected property for the appropriate items. At run-time, the mouse can be use toggle the selected state for one or more of the list items.

Click
  Toggles the selected state for the list item under the mouse pointer.
Shift+Click
  Toggles the selected state for a contiguous block of list items from the mouse pointer to the previous item selection.
Ctrl+Click
  Toggles the selected state list item under the mouse pointer without altering the previously selected list items.
Ctrl+Shift+Click
  Toggles the selected state for a contiguous block of list items from the mouse pointer to the previously focused list item.

MultiSelect is one of the TListViewProperty values included in the TListViewProperties set type and exchanged with the widgetset class. The property value is read from and written to the TCustomTreeview widgetset class instance when its handle is valid. Changing the value for the property causes the widgetset class to be updated with the new value.

Use SelCount to get the number of selected items when MultiSelect is enabled. Use Items to access the list items to check the values in their Selected properties.

Use SelectAll to set the selected state to True for all of the Items on the control.

Use ClearSelection to clear the selected state for all of the Items on the control.

## See also

TCustomListView.Items |  | Collection of list items displayed on the list view control.
TCustomListView.SelCount |  | Number of currently selected Items when MultiSelect is enabled.
TCustomListView.Selected |  | Contains the selected list item in the list view control.
TCustomListView.SelectAll |  | Selects all Items in the control when MultiSelect has been enabled.
TCustomListView.ClearSelection |  | Clears the selected items for the list view control.
TListItem.Selected |  | Whether this Item has been Selected (often denoted by a check-mark).
TListViewProperties |  | Set type used to store values from the TListViewProperty enumeration.
TListViewProperty |  | Represents Boolean properties used in TCustomListView.