Skip to main content
A newer version of this page is available. .

ImageComboBoxEdit.SelectedItem Property

Gets or sets the selected item.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.1.dll

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