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

# TCustomListView.ItemDeleted

Called when the specified list item is removed from the list.

## Declaration

Source position: comctrls.pp line 1516

`protected procedure TCustomListView.ItemDeleted(`
`const AItem: TListItem`
`);`

## Arguments

`AItem` |  | TListItem instance deleted from the Items for the control.

## Description

ItemDeleted is a method called when the specified list item is removed from the Items for the control.

ItemDeleted ensures that the list item in AItem is not referenced as a selected or focused item on the control. If AItem is the value in Selected, Selected is set to Nil and the control flags are updated to removed the valid selection flag (ffSelectedValid). If AItem is the focused list item on the control, the focus reference is set to Nil.

ItemDeleted is called when the TListItem instance in AItem is freed from the container in Items. ItemDeleted calls DoDeletion to execute the Delete method in TCustomListView (when not overridden) or signal the OnDeletion event handler (when assigned).