Skip to main content

TcxCustomMRUEdit.AddItem(string) Method

Adds a new item or moves the existing one to the top of the dropdown list.

Declaration

procedure AddItem(const Value: string); virtual;

Parameters

Name Type
Value string

Remarks

The AddItem method places an item passed as the Value parameter to the top of the dropdown list. If the specified item already exists in the list, it is moved to the first position. So, the AddItem method places the most recently used items at the top of the list. Use the Properties.LookupItems property to access this list. After the item is added to the list, the Properties.OnNewLookupDisplayText event is raised.

Note

When the Properties.MaxItemCount property is assigned a value greater than 0, and a new item is added to a list that already contains Properties.MaxItemCount items, the last item is removed from the list. You can handle the Properties.OnDeleteLookupItem event to implement your own custom logic, before the last item is removed.

See Also