Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

ComboBox

MikhailTymchukDX edited this page Apr 12, 2017 · 4 revisions

Demo Page

Like AutoCompleteExtender, a combo box is an ASP.NET AJAX control that combines the flexibility of the TextBox with a list of options from which users are able to choose.

Properties

Name Description
AutoCompleteMode Determines how the ComboBox automatically completes typed text.
Remarks: When Suggest is specified, the ComboBox will show a list, highlight the first matched item, and if necessary, scroll the list to show the highlighted item. If Append is specified, the ComboBox will append the remainder of the first matched item to the user-typed text and highlight the appended text. When SuggestAppend is specified, both of the above behaviors are applied. If None (the default value) is specified, the ComboBox' auto-complete behaviors are disabled.
AutoPostBack Determines whether or not AutoPostBack should be used.
BackColor A background color.
BorderColor The ComboBox border color.
BorderStyle The ComboBox border style.
BorderWidth The ComboBox border width.
CaseSensitive Specifies whether or not user-typed text matches items in the list in a case-sensitive manner. The default is false.
DropDownStyle Determines whether or not a user is allowed to enter text that does not match an item in the list and if the list is always displayed.
Remarks: If "DropDownList" is specified, users are not allowed to enter text that does not match an item in the list. When "DropDown" (the default value) is specified, any text is allowed. If "Simple" is specified, any text is allowed and the list is always displayed regardless of the AutoCompleteMode property value.
Enabled Determines whether or not the ComboBox is enabled.
Font The ComboBox control font.
ForeColor A foreground color.
Height ComboBox height.
ItemInsertLocation Determines if to "Append" or "Prepend" new items when they are inserted into the list or insert them in an "Ordinal" manner (alphabetically) based on the item Text or Value. The default is "Append"
ListItemHoverCssClass When specified, replaces default styles applied to highlighted items in the list with a custom css class.
MaxLength Specifies maximum length of the associated TextBox control.
RenderMode Specifies whether or not the ComboBox is rendered as an Inline or Block level HTML element. The default is Inline.
SelectedIndex The ComboBox selected item index.
TabIndex The ComboBox tab index.
Width ComboBox width.

Methods

Name Description
RaisePostDataChangedEvent() Raises PostDataChangeEvent.
RenderControl(writer) Renders a control.
ResolveControl(controlId) Resolves a control

Events

Name Description
ItemInserted Fires when an item is inserted.
ItemInserting Fires on inserting an item.

Client properties

Name Description
autoCompleteMode Determines how the ComboBox automatically completes typed text.
autoPostBack Determined whether or not to use AutoPostBack.
buttonControl A Button control.
caseSensitive Specifies whether user-typed text matches items in the list in a case-sensitive manner. The default is false.
comboTableControl A ComboBox table control.
dropDownStyle Determines whether or not a user is allowed to enter text that does not match an item in the list and if the list is always displayed.
hiddenFieldControl A hidden field control.
listItemHoverCssClass When specified, replaces the default styles applied to highlighted items in the list with a custom css class.
optionListControl An OptionList control.
selectedIndex The ComboBox selected item index.
textBoxControl A TextBox control.

Client events

Name Description
selectedIndexChanged An event handler rised when selected index changed

Client properties

autoCompleteMode

Determines how the ComboBox automatically completes typed text.

Remarks: When "Suggest" is specified, the ComboBox will show the list, highlight the first matched item, and if necessary, scroll the list to show the highlighted item. If "Append" is specified, the ComboBox will append the remainder of the first matched item to the user-typed text and highlight the appended text. When "SuggestAppend" is specified, both of the above behaviors are applied. If "None" (the default value) is specified, the ComboBox's auto-complete behaviors are disabled.

Getter name: get_autoCompleteMode()
Setter name: set_autoCompleteMode(value)

autoPostBack

Determined whether or not to use AutoPostBack.

Getter name: get_autoPostBack()
Setter name: set_autoPostBack(value)

buttonControl

A Button control.

Getter name: get_buttonControl()
Setter name: set_buttonControl(value)

caseSensitive

Specifies whether user-typed text matches items in the list in a case-sensitive manner. The default is false.

Getter name: get_caseSensitive()
Setter name: set_caseSensitive(value)

comboTableControl

A ComboBox table control.

Getter name: get_comboTableControl()
Setter name: set_comboTableControl(value)

dropDownStyle

Determines whether or not a user is allowed to enter text that does not match an item in the list and if the list is always displayed.

Remarks: If "DropDownList" is specified, users are not allowed to enter text that does not match an item in the list. When "DropDown" (the default value) is specified, any text is allowed. If "Simple" is specified, any text is allowed and the list is always displayed regardless of the AutoCompleteMode property value.

Getter name: get_dropDownStyle()
Setter name: set_dropDownStyle(value)

hiddenFieldControl

A hidden field control.

Getter name: get_hiddenFieldControl()
Setter name: set_hiddenFieldControl(value)

listItemHoverCssClass

When specified, replaces the default styles applied to highlighted items in the list with a custom css class.

Getter name: get_listItemHoverCssClass()
Setter name: set_listItemHoverCssClass(value)

optionListControl

An OptionList control.

Getter name: get_optionListControl()
Setter name: set_optionListControl(value)

selectedIndex

The ComboBox selected item index.

Getter name: get_selectedIndex()
Setter name: set_selectedIndex(value)

textBoxControl

A TextBox control.

Getter name: get_textBoxControl()
Setter name: set_textBoxControl(value)

Methods

RaisePostDataChangedEvent()

Raises PostDataChangeEvent.

RenderControl(writer)

Renders a control.

Params:

  • writer
    • Type:
    • Description: HTML text writer

ResolveControl(controlId)

Resolves a control

Params:

  • controlId
    • Type:
    • Description: ID of the control

Client events

selectedIndexChanged

An event handler rised when selected index changed

Add event handler method: add_selectedIndexChanged(handler)
Remove event handler method: remove_selectedIndexChanged(handler)
Raise event method: raise_selectedIndexChanged()

Clone this wiki locally