Skip to main content
Version: 3.5

ListBox

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents a control to display a list of items.

public class ListBox : ListControl, IModified, ILabel, IReadOnly

Constructors

Instance memberListBox()

Initializes a new instance of ListBox.

Instance memberListBox(onSelectedIndexChanged)

Initializes a new instance of the ListBox class with the specified settings.

NameTypeDescription
onSelectedIndexChangedAction<Object, EventArgs>Optional SelectedIndexChanged handler.

Instance memberListBox(dataSource, displayMember, valueMember, iconMember, onSelectedIndexChanged)

Initializes a new instance of ListBox class with the specified settings.

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

Instance memberListBox(location, size, onSelectedIndexChanged)

Initializes a new instance of the ListBox class with the specified settings.

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

Instance memberListBox(location, size, dataSource, displayMember, valueMember, iconMember, onSelectedIndexChanged)

Initializes a new instance of the ListBox class with the specified settings.

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

Properties

Instance memberAllowHtml

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

Instance memberHorizontalScrollbar

Boolean: Returns or sets whether a horizontal scroll bar is displayed in the control. (Default: False)

Instance memberIncrementalSelection

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

Instance memberItemHeight

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

Throws:

Instance memberItems

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

Instance memberLabel

LabelWrapper: Provides a label related to the control.

Instance memberLabelText

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

Instance memberLazyLoading

Boolean: Returns or sets whether the items in the list are send to the client when the list becomes visible the first time. (Default: False)

Instance memberOrientation

Orientation: Returns or sets whether the list box displays the items vertically (default) or horizontally. Since 3.1 (Default: Vertical)

Throws:

Instance memberReadOnly

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

Instance memberRightClickSelection

Boolean: Returns or sets whether the item under the pointer gets selected on a right click. (Default: False)

When the right click lands outside of a selected area the selection is not changed regardless of the value of RightClickSelection.

Instance memberScrollAlwaysVisible

Boolean: Returns or sets whether the vertical scroll bar is shown at all times. (Default: False)

Instance memberSelectedIndex

Int32: Returns or sets the zero-based index of the currently selected item in a ListBox.

Throws:

Instance memberSelectedIndices

SelectedIndexCollection: Returns a collection that contains the zero-based indexes of all currently selected items in the ListBox.

Instance memberSelectedItem

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

Instance memberSelectedItems

SelectedObjectCollection: Returns a collection containing the currently selected items in the ListBox.

Instance memberSelectionMode

SelectionMode: Returns or sets the method in which items are selected in the ListBox. (Default: One)

Instance memberSorted

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

Throws:

Instance memberTools

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

Instance memberTopIndex

Int32: Returns or sets the index of the first visible item in the ListBox.

Methods

Instance memberBeginUpdate()

Not used. Kept for compatibility.

Instance memberClearSelected()

Unselects all items in the ListBox.

Instance memberEndUpdate()

Not used. Kept for compatibility.

Instance memberFindString(text, startIndex)

Returns the index of the first item in the ListBox beyond the specified index that contains 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 memberFindString(text)

Returns the index of the first item in the ListBox 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 memberFindStringExact(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 memberFindStringExact(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.

Instance memberGetSelected(index)

Returns a value indicating whether the specified item is selected.

ParameterTypeDescription
indexInt32The zero-based index of the item that determines whether it is selected.

Returns: Boolean. true if the specified item is currently selected in the ListBox; otherwise, false.

Throws:

Instance memberSelectAll()

Selects all the items in the ListBox.

Instance memberSetSelected(index, selected)

Selects or clears the selection for the specified item in a ListBox.

ParameterTypeDescription
indexInt32The zero-based index of the item in a ListBox to select or clear the selection for.
selectedBooleantrue to select the specified item; otherwise, false.

Throws:

Events

Instance memberLoad

EventHandler Fired when the LazyLoading property is true and the ListBox is first shown.

When LazyLoading is true An application may fill the items at any time prior to the ListBox being shown, or while processing the Load event.

Instance memberReadOnlyChanged

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

Instance memberSelectedIndexChanged

EventHandler Fired when the SelectedIndex property or the SelectedIndices collection has changed.

Instance memberSortedChanged

EventHandler Fired when the Sorted property has changed.

Instance memberToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Inherited By

NameDescription
CheckedListBoxDisplays a ListBox in which a check box is displayed to the left of each item.

Implements

NameDescription
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.