Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomMRUEdit.AddItem(string) Method

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

#Declaration

Delphi
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