Skip to main content

ComboBoxItemCollection.AddRange(Object[]) Method

Adds an array of items to the collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void AddRange(
    object[] items
)

Parameters

Name Type Description
items Object[]

An array of objects representing items for the combo box editor.

Remarks

The AddRange method adds an array of object to the current collection. Each object will represent an item in the dropdown list in a combo box editor.

Whenever you select a specific element from the dropdown list in a combo box editor, a corresponding object is assigned to the ComboBoxEdit.SelectedItem property and the edit box displays the textual representation of the object.

See the ComboBoxItemCollection.Add method to add a single object to the collection.

Note: to ensure proper functionality of the editor, items in the RepositoryItemComboBox.Items collection must be unique objects.

Example

The following code adds four string type elements to the item collection of a combo box editor:

  string [] elems = new string[] {"Frankfurt", "Helsinki", "Kirkland", "London"};
  comboBoxEdit1.Properties.Items.AddRange(elems);      

The following code snippets (auto-collected from DevExpress Examples) contain references to the AddRange(Object[]) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also