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

ImageComboBoxEdit.SelectedItem Property

Gets or sets the selected item.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[Browsable(false)]
public override object SelectedItem { get; set; }

#Property Value

Type Description
Object

A selected item.

#Remarks

The SelectedItem property specifies the currently selected ImageComboBoxItem object, i.e. the item displayed in the edit box. The value of the selected item is determined by its ComboBoxItem.Value property.

When you assign a value to SelectedItem, the editor checks whether the new value represents an item in the RepositoryItemImageComboBox.Items collection. If the object does not belong to the collection, the selected item is not changed. Otherwise, the edit value and selected item are changed (i.e. the edit value matches the value of the selected item).

The ImageComboBoxEdit.EditValue property can be set to any object. When setting ImageComboBoxEdit.EditValue, the control searches the collection for an item with the same value. If found, the corresponding selected item can be retrieved via the SelectedItem property. If no such an item is found, reading the SelectedItem property returns null and ComboBoxEdit.SelectedIndex specifies -1.

Note: To ensure that an ImageComboBoxEdit control functions correctly, item values must be unique within the item collection.

See Also