ListBox

Wisej.Web.ListBox

Namespace: Wisej.Web

Assembly: Wisej.Framework (2.5.0.0)

Represents a control to display a list of items.

public class ListBox : ListControl

Constructors

ListBox()

Initializes a new instance of ListBox.

Properties

AllowHtml

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

HorizontalScrollbar

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

IncrementalSelection

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

ItemHeight

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

Throws:

Items

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

Label

LabelWrapper: Provides a label related to the control.

LabelText

String: Returns or sets the localizable label associated with this control.

LazyLoading

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

ReadOnly

Boolean: Returns or sets whether the control is read-only.

RightClickSelection

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

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

ScrollAlwaysVisible

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

SelectedIndex

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

Throws:

SelectedIndices

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

SelectedItem

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

SelectedItems

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

SelectionMode

SelectionMode: Returns or sets the method in which items are selected in the ListBox.

Sorted

Boolean: Returns or sets whether the items in the combo box are sorted.

Throws:

Tools

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

TopIndex

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

Methods

BeginUpdate()

Not used. Kept for compatibility.

ClearSelected()

Unselects all items in the ListBox.

EndUpdate()

Not used. Kept for compatibility.

FindString(text)

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

Parameter
Type
Description

text

The String to search for.

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

FindString(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.

Parameter
Type
Description

text

The String to search for.

startIndex

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

FindStringExact(text)

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

Parameter
Type
Description

text

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

FindStringExact(text, startIndex)

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

Parameter
Type
Description

text

The String to search for.

startIndex

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

GetSelected(index)

Returns a value indicating whether the specified item is selected.

Parameter
Type
Description

index

The 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:

SelectAll()

Selects all the items in the ListBox.

SetSelected(index, selected)

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

Parameter
Type
Description

index

The zero-based index of the item in a ListBox to select or clear the selection for.

selected

true to select the specified item; otherwise, false.

Throws:

Events

Load

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.

ReadOnlyChanged

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

SelectedIndexChanged

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

SortedChanged

EventHandler Fired when the Sorted property has changed.

ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Inherited By

Name
Description

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

Implements

Name
Description

Bindable components implement this interface.

All wisej components implement this interface.

All wisej controls derived from the Control class must implement this interface.

Allows an object to serialize itself.

Last updated