ASPxListBox
- 3 minutes to read
The ASPxListBox control displays a list of items that can be selected by end-users.
Features
Multiple Selection
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). Filtering
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.
Multi-Column Mode
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
The ASPxListBox allows you to customize the appearance of its items using the ASPxListBox.ItemTextCellPrepared event for cells and the ASPxListBox.ItemRowPrepared event for rows.
Built-in Validation
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 ASPxClientListBox.AddItem 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. ASPxClientListBox.BeginUpdate Prevents the client list box editor from being rendered until the ASPxClientListBox.EndUpdate method is called. ASPxClientListBox.EndUpdate Re-enables editor render operations after a call to the ASPxClientListBox.BeginUpdate method, and forces an immediate re-rendering. ASPxClientListBox.ClearItems Removes all items from the client list box editor. ASPxClientListBox.FindItemByText Returns a list box item by its text. ASPxClientListBox.FindItemByValue Returns a list box item by its value. ASPxClientListBox.GetItem Returns an item specified by its index within the list box editor’s item collection. ASPxClientListBox.GetItemCount Gets the number of items contained in the editor’s item collection. ASPxClientListBox.GetSelectedIndices Returns an array of the list editor’s selected items indices. ASPxClientListBox.GetSelectedItems Returns an array of the list editor’s selected items. ASPxClientListBox.GetSelectedValues Returns an array of the list editor’s selected items values. ASPxClientListBox.InsertItem Adds a new item to the control’s items collection at the specified index. ASPxClientListBox.MakeItemVisible Scrolls the editor’s item list, so that the specified item becomes visible. ASPxClientListBox.RemoveItem Removes an item specified by its index from the client list editor. ASPxClientListBox.SelectAll Selects all list box items. ASPxClientListBox.SelectIndices Selects the items with the specified indices within a list box. ASPxClientListBox.SelectItems Selects the specified items within a list box. ASPxClientListBox.SelectValues Select the items with the specified values within a list box. ASPxClientListBox.UnselectAll Unselects all list box items. ASPxClientListBox.UnselectIndices Unselects an array of the list box items with the specified indices. ASPxClientListBox.UnselectItems Unselects an array of the specified list box items. ASPxClientListBox.UnselectValues Unselects an array of the list box items with the specified values.