- 3 minutes to read
The ASPxListBox control displays a list of items that can be selected by end-users.
The ASPxListBox editor allows selecting multiple list items at the same time using the ASPxListBox.SelectionMode property. The following selection modes are available:
Selection Mode Description Single End-users can select only one item within the editor. Multiple End-users can select multiple items within the editor by clicking list items while pressing Ctrl (to add an individual item) or Shift (to select a range of items). CheckColumn End-users can select multiple items within the editor by clicking list items (use the Shift key to select a range of items).
End-users can filter items by entering text in the filter editor above the list. To make the filter editor visible, set the ListBoxFilteringSettings.ShowSearchUI property to true. When an end-user types a filter string, the items list is automatically updated to display only the items that match the filter string. To make all the list box items visible, clear the filter editor.
The list box editor allows displaying its list data in several columns. This functionality is in effect if the editor's items collection is obtained from a data source.
Item Appearance Customization
You can perform the editor’s data validation both on the client and server side. See the Validation topic to learn more.
Full-Featured Client-Side API
Access the ASPxListBox client-side API using the ASPxClientListBox object. You can modify the editor's behavior using the following methods:
Method Description AddItem(text) Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. BeginUpdate Prevents the client list box editor from being rendered until the ASPxClientListBox.EndUpdate method is called. EndUpdate Re-enables editor render operations after a call to the ASPxClientListBox.BeginUpdate method, and forces an immediate re-rendering. ClearItems Removes all items from the client list box editor. FindItemByText(text) Returns a list box item by its text. FindItemByValue(value) Returns a list box item by its value. GetItem(index) Returns an item specified by its index within the list box editor's item collection. GetItemCount Gets the number of items contained in the editor's item collection. GetSelectedIndices Returns an array of the list editor's selected items indices. GetSelectedItems Returns an array of the list editor's selected items. GetSelectedValues Returns an array of the list editor's selected items values. InsertItem(index, text) Adds a new item to the control's items collection at the specified index. MakeItemVisible(index) Scrolls the editor's item list, so that the specified item becomes visible. RemoveItem(index) Removes an item specified by its index from the client list editor. SelectAll Selects all list box items. SelectIndices(indices) Selects the items with the specified indices within a list box. SelectItems(items) Selects the specified items within a list box. SelectValues(values) Select the items with the specified values within a list box. UnselectAll Unselects all list box items. UnselectIndices(indices) Unselects an array of the list box items with the specified indices. UnselectItems(items) Unselects an array of the specified list box items. UnselectValues(values) Unselects an array of the list box items with the specified values.