Tab
A newer version of this page is available. Switch to the current version.

ASPxComboBox Class

Represents an editor which displays a list of items within its dropdown window.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

public class ASPxComboBox :
    ASPxAutoCompleteBoxBase,
    IListBoxColumnsOwner,
    IValueTypeHolder,
    IControlDesigner,
    IListEditItemRequestEventOwner,
    IListEditCustomFilteringEventOwner,
    IListEditServerModeOwner
Public Class ASPxComboBox
    Inherits ASPxAutoCompleteBoxBase
    Implements IListBoxColumnsOwner,
               IValueTypeHolder,
               IControlDesigner,
               IListEditItemRequestEventOwner,
               IListEditCustomFilteringEventOwner,
               IListEditServerModeOwner

Remarks

The ASPxComboBox represents a control that combines the functionality of a single-line text editor, button editor and dropdown list editor. The editor's dropdown displays a list of items which can be selected by end-users. Selecting an item changes the editor's edit value. Depending upon the ASPxComboBox.DropDownStyle property's setting, users can change the editor's value by simply selecting an item from the dropdown list, or they can be permitted to input new values into the editor's edit box.

ASPxComboBox_control.png

The ASPxComboBox editor's item list can be generated dynamically through data binding or populated manually. List items are contained within the editor's ASPxAutoCompleteBoxBase.Items collection. For an individual item, the caption text (ListEditItem.Text), associated value (ListEditItem.Value) and display image (ListEditItem.ImageUrl) can be defined.

NOTE

For the ASPxComboBox editor to function properly, values of all list items in the ASPxAutoCompleteBoxBase.Items collection should be unique. There should not be two or more list items with the same value of the ListEditItem.Value property.

To specify the selected item, the control's ASPxComboBox.SelectedItem or ASPxComboBox.SelectedIndex property can be used. Values of list items can be associated with any value type which is specified by the ASPxComboBox.ValueType property.

NOTE

An item's value (ASPxListEdit.ValueField](xref:DevExpress.Web.ASPxListEdit.ValueField)) should be unique.

If an item from the dropdown list is selected, the item's caption text is displayed within the editor's text box, and the associated value is assigned to the editor's ASPxEdit.Value property. When the selected item changes, the ASPxComboBox.SelectedIndexChanged event is generated.

In order to bind the ASPxComboBox to a data source, the ASPxListEdit.DataSourceID (ASPxEditBase.DataSource) and ASPxEditBase.DataMember properties can be used. When retrieving items from the data source, item characteristics such as the text, value and image, are obtained from specific data fields defined via the ASPxListEdit.TextField, ASPxListEdit.ValueField and ASPxListEdit.ImageUrlField properties.

You can specify the dropdown window's dimensions and appearance using the ASPxAutoCompleteBoxBase.DropDownHeight, ASPxAutoCompleteBoxBase.DropDownWidth and ASPxComboBox.DropDownStyle properties. The appearance of the item l