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

# TListItems.AddItem

Adds the specified list item to the storage for the container.

## Declaration

Source position: comctrls.pp line 1167

`public procedure TListItems.AddItem(`
`AItem: TListItem`
`);`

## Arguments

`AItem` |  | TListItem instance added to the container and its cache.

## Description

AddItem is method used to add the list item specified in AItem to the storage for the container.

The position for the list item in internal storage and the class instance are stored in local cache entries. The widgetset class for the list view control is notified when its handle is allocated of the updated cache values.

If a list view control has been assigned to Owner, its ItemInserted method is called. ItemInserted can execute an overridden InsertItem method (when available) or signal the OnInsert event handler for the list view control (when assigned).

Use InsertItem to store a list item at a specified position in the internal storage for the container.

## See also

TCustomListView.ItemInserted |  | Performs actions when a list item has been inserted in the Items collection.
TCustomListView.InsertItem |  | Inserts an Item into the List.
TCustomListView.OnInsert |  | Event handler signalled when a list item is added to or inserted in the Items for the control.