Skip to main content
Version: 4.1

ComboBox

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a combo box control.

public class ComboBox : ListControl, ILabel, IReadOnly

Constructors

Instance member ComboBox()

Initializes an instance of ComboBox.

Instance member ComboBox(onSelectedIndexChanged)

Initializes a new instance of ComboBox class with specific initial settings.

NameTypeDescription
onSelectedIndexChangedAction<Object, EventArgs>SelectedIndexChanged handler.

Instance member ComboBox(label, onSelectedIndexChanged)

Initializes a new instance of ComboBox class with specific initial settings.

NameTypeDescription
labelStringThe initial text to display in the TextBox label.
onSelectedIndexChangedAction<Object, EventArgs>SelectedIndexChanged handler.

Instance member ComboBox(dataSource, displayMember, valueMember, iconMember, onSelectedIndexChanged)

Initializes a new instance of ComboBox class with specific initial settings.

NameTypeDescription
dataSourceObjectInitial DataSource.
displayMemberStringInitial DisplayMember.
valueMemberStringInitial ValueMember.
iconMemberStringInitial IconMember.
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Instance member ComboBox(location, size, onSelectedIndexChanged)

Initializes an instance of ComboBox with the given datasource, size, location, and action.

NameTypeDescription
locationPointInitial location.
sizeSizeInitial size.
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Instance member ComboBox(location, size, dataSource, displayMember, valueMember, iconMember, onSelectedIndexChanged)

Initializes an instance of ComboBox with the given datasource, size, location, and action.

NameTypeDescription
locationPointInitial location.
sizeSizeInitial size.
dataSourceObjectInitial DataSource.
displayMemberStringInitial DisplayMember.
valueMemberStringInitial ValueMember.
iconMemberStringInitial IconMember.
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Instance member ComboBox(label, location, size, onSelectedIndexChanged)

Initializes an instance of ComboBox with the given datasource, size, location, and action.

NameTypeDescription
labelStringThe initial text to display in the TextBox label.
locationPointInitial location.
sizeSizeInitial size.
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Instance member ComboBox(label, location, size, dataSource, displayMember, valueMember, iconMember, onSelectedIndexChanged)

Initializes an instance of ComboBox with the given datasource, size, location, and action.

NameTypeDescription
labelStringThe initial text to display in the TextBox label.
locationPointInitial location.
sizeSizeInitial size.
dataSourceObjectInitial DataSource.
displayMemberStringInitial DisplayMember.
valueMemberStringInitial ValueMember.
iconMemberStringInitial IconMember.
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Properties

Instance member AllowHtml

Boolean: Returns or sets a value indicating that the control can display html in the Text property. (Default: False)

Instance member AutoCompleteMode

AutoCompleteMode: Returns or sets how automatic completion works for the ComboBox. (Default: None)

Instance member AutoSize

Boolean: Returns or sets whether the height of the control is set automatically. (Default: True)

Instance member CharacterCasing

CharacterCasing: Returns or sets whether the ComboBox control modifies the case of characters as they are typed. (Default: Normal)

Protected member DefaultSize

Size: Returns the default size for the ComboBox control.

Int32: Returns or sets the maximum height in pixels of the drop-down portion of the ComboBox. (Default: 400)

Throws:

ComboBoxStyle: Returns or sets the drop down style of the combo box. (Default: DropDown)

Int32: Returns or sets the maximum width in pixels of the drop-down list of the ComboBox. When the value is 0, the drop-down list will grow to fit the largest item. (Default: 0)

Throws:

Instance member DroppedDown

Boolean: Returns or sets whether the combo box is displaying its drop-down portion.

Instance member EnableNativeContextMenu

Boolean: Enables or disables the browser's context menu. (Default: True)

Instance member IncrementalSelection

Boolean: Returns or sets whether items are selected incrementally as the user types within a timeout of 1 second. (Default: True)

Instance member ItemHeight

Int32: Gets or sets the height of the list items in the drop-down list. When the value is -1, uses the value set in the theme. (Default: -1)

Throws:

Instance member Items

ObjectCollection: Returns the collection of the items contained in this ComboBox.

Instance member Label

LabelWrapper: Provides a label related to the control.

Instance member LabelText

String: Returns or sets the localizable label associated with this control. (Default: "")

Instance member LazyLoading

Boolean: Returns or sets whether the items are sent to the client the first time the list is opened and enables the Load event. (Default: False)

Instance member MaxLength

Int32: Returns or sets the number of characters a user can type into the ComboBox. (Default: 0)

Throws:

Instance member ReadOnly

Boolean: Returns or sets whether the control is read-only. (Default: False)

Instance member SelectedIndex

Int32: Returns or sets the index of the currently selected item.

Throws:

  • ArgumentOutOfRangeException The specified index is less than -1; o the specified index is greater than the number of items in the combo box.

Instance member SelectedItem

Object: Returns or sets currently selected item in the ComboBox.

Instance member SelectedText

String: Returns or sets the text that is selected in the editable portion of a ComboBox.

Instance member SelectionLength

Int32: Returns or sets the number of characters selected in the editable portion of the combo box.

Throws:

Instance member SelectionStart

Int32: Returns or sets the starting index of text selected in the combo box.

Throws:

Instance member Sorted

Boolean: Returns or sets whether the items in the combo box are sorted. (Default: False)

Throws:

Instance member SpellCheck

Boolean: Returns or sets whether the text in the ComboBox is spell checked by the browser. (Default: False)

Instance member Text

String: Returns or sets the text associated with this control. (Default: "")

Instance member Tools

ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this control.

Instance member Watermark

String: Returns or sets the text to show when the control is empty. (Default: null)

Methods

Instance member BeginUpdate()

Not used. Kept for compatibility.

Instance member Copy()

Copies the current selection in the text box to the Clipboard.

Protected member CreateItemCollection()

Creates a new instance of the item collection.

Returns: ObjectCollection. A ObjectCollection that represents the new item collection.

Instance member Cut()

Moves the current selection in the text box to the Clipboard.

Protected member Dispose(disposing)

Disposes the control.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member EndUpdate()

Not used. Kept for compatibility.

Instance member FindString(text)

Returns the index of the first item in the ComboBox that starts with the specified string.

ParameterTypeDescription
textStringThe String to search for.

Returns: Int32. The zero-based index of the first item found; returns -1 if no match is found.

Instance member FindString(text, startIndex)

Returns the index of the first item in the ComboBox beyond the specified index that starts with the specified string. The search is not case sensitive.

ParameterTypeDescription
textStringThe String to search for.
startIndexInt32The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.

Returns: Int32. The zero-based index of the first item found; returns -1 if no match is found, or 0 if the text parameter specifies Empty.

Instance member FindStringExact(text)

Finds the first item in the combo box that matches the specified string.

ParameterTypeDescription
textStringThe String to search for.

Returns: Int32. The zero-based index of the first item found; returns -1 if no match is found, or 0 if the text parameter specifies Empty.

Instance member FindStringExact(text, startIndex)

Finds the first item after the specified index that matches the specified string.

ParameterTypeDescription
textStringThe String to search for.
startIndexInt32The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.

Returns: Int32. The zero-based index of the first item found; returns -1 if no match is found, or 0 if the text parameter specifies Empty.

Protected member OnAutoComplete(e)

Fires the AutoComplete event.

ParameterTypeDescription
eHandledEventArgsA HandledEventArgs that contains the event data.

Protected member OnDataSourceChanged(e)

Fires the DataSourceChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDisplayMemberChanged(e)

Fires the DisplayMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDropDown(e)

Fires the DropDown event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDropDownClosed(e)

Fires the DropDownClosed event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDropDownStyleChanged(e)

Fires the DropDownStyleChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnLeave(e)

ParameterTypeDescription
eEventArgs

Protected member OnLoad(e)

Fires the Load event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnReadOnlyChanged(e)

Fires the ReadOnlyChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnSelectedIndexChanged(e)

Fires the SelectedIndexChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelectedItemChanged(e)

Fires the SelectedItemChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelectionChangeCommitted(e)

Fires the SelectionChangeCommitted event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSortedChanged(e)

Fires the SortedChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnToolClick(e)

Fires the ToolClick event.

ParameterTypeDescription
eToolClickEventArgsA ToolClickEventArgs that contains the event data.

Protected member OnValueMemberChanged(e)

Fires the ValueMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member OnWebUpdate(state)

Updates the client component using the state information.

ParameterTypeDescription
stateObjectDynamic state object.

Instance member Paste()

Replaces the current selection in the text box with the contents of the Clipboard.

Protected member RefreshItem(index)

Refreshes the item contained at the specified location.

ParameterTypeDescription
indexInt32The location of the item to refresh.

Protected member RefreshItems()

Reloads all the ComboBox items from the data source.

Instance member Select(start, length)

Selects a range of text in the editable portion of the ComboBox.

ParameterTypeDescription
startInt32The position of the first character in the current text selection within the text box.
lengthInt32The number of characters to select.

Instance member SelectAll()

Selects all the text in the editable portion of the ComboBox.

Protected member SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the ComboBox control.

ParameterTypeDescription
xInt32The new Left property value of the control.
yInt32The new Top property value of the control.
widthInt32The new Width property value of the control.
heightInt32Not used.
specifiedBoundsSpecifiedA combination of the BoundsSpecified values.

Protected member SetItemCore(index, value)

Sets the object with the specified index in the derived class.

ParameterTypeDescription
indexInt32The array index of the object.
valueObjectThe object.

Protected member SetItemsCore(value)

Sets the specified array of objects in a collection in the derived class.

ParameterTypeDescription
valueIListAn array of items.

Protected member Sort()

Sorts the items in the ComboBox.

Events

Instance member AutoComplete

HandledEventHandler Fired before the Validating event when DropDownStyle is set to DropDown or Simple.

The application may implement a different way to select the item when the user types a text and the ComboBox is validated. Set e.Handled to true to override the standard behavior.



this.comboBox1.AutoComplete += (s, e) =>
{
if (this.comboBox1.Text == "T")
{
this.compoBox1.SelectedIndex = 1;
e.Handled = true;
}
}


EventHandler Fired when the drop-down portion of a ComboBox is shown.

EventHandler Fired when the drop-down portion of the ComboBox is no longer visible.

EventHandler Fired when the DropDownStyle property has changed.

Instance member Load

EventHandler Fired when the drop-down list is first opened and the LazyLoading property is true.

When LazyLoading is true An application may fill the items at any time prior to the drop-down list being opened, or while processing the DropDown or Load event.

Instance member ReadOnlyChanged

EventHandler Fired when the value of the ReadOnly property has changed.

Instance member SelectedIndexChanged

EventHandler Fired when the SelectedIndex property has changed.

Instance member SelectedItemChanged

EventHandler Fired when the SelectedItem property has changed.

Instance member SelectionChangeCommitted

EventHandler Fired when the selected item has changed and that change is displayed in the ComboBox.

Instance member SortedChanged

EventHandler Fired when the Sorted property has changed.

Instance member ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Inherited By

NameDescription
DataGridViewComboBoxEditingControlRepresents a ComboBox control that can be hosted in a DataGridViewComboBoxCell.
ListViewComboBoxThe TreeViewComboBox control represents a UserComboBox control with a ListView as the drop down panel.
TreeViewComboBoxThe TreeViewComboBox control represents a UserComboBox control with a TreeView as the drop down panel.
UserComboBoxThe UserComboBox control represents a ComboBox control with a custom panel that drops down when the user clicks the down arrow.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
ILabelProvides access to the LabelWrapper associated with the controls that implement this interface.
IReadOnlyProvides access to the ReadOnly property for coontrols that support the read-only mode.
IModifiedProvides access to the Modified property and ModifiedChanged event for controls that implement this interface.
IValidationProvides access to the validation events and properties property for controls that support validation.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.