New to Telerik UI for WinForms? Download free 30-day trial

Selection

Selection Mode

RadDropDownList supports three types of selection modes:

  • One: Only one item can be selected.

  • MultiSimple: Multiple items can be selected.

  • MultiExtended: Multiple selection which can also be performed by using the Ctrl, Shift and arrow keys.

Figure 1: MutiExtended Selection Mode

WinForms RadDropDownList MutiExtended Selection Mode

Setting a Selection Mode

this.radDropDownList1.DropDownListElement.SelectionMode = SelectionMode.MultiExtended;

Me.radDropDownList1.DropDownListElement.SelectionMode = SelectionMode.MultiExtended

Select Next Item

RadDropDownList can automatically select the next item when a double click in the edit box is performed.

Figure 2: Select Next Item

WinForms RadDropDownList Select Next Item

Next Item Selection

this.radDropDownList1.SelectNextOnDoubleClick = true;

Me.radDropDownList1.SelectNextOnDoubleClick = True

Selection Events

There are couple of events to which you can subscribe your RadDropDownList and retrieve information about the selected value or index:

  • SelectedIndexChanging: Raised before the index actually changes, the handler is a suitable place to cancel the operation if the application logic requires it.

  • SelectedIndexChanged: Raised after the index had been changed, the event arguments provide information about the new position of the selected item.

  • SelectedValueChanged: Raised if RadDropDownList.SelectedValue has been changed.

Programmatically Select Items

Items can be programmatically selected either by their value or by their logical representation, the RadListDataItem. The responsible properties can be directly accessed from the RadDropDownList object:

  • SelectedValue: Defines the currently selected value, its type needs to be the same as the type of the elements which populate the RadDropDownList.

  • SelectedItem: This is the logical representation of the selected value, its type is RadListDataItem.

  • SelectedIndex: Selects an item according to its index in the Items collection.

  • SelectedItems: Returns a collection of the currently selected items

Setting these properties will result in raising the selection events.


this.radDropDownList1.SelectedItem = this.radDropDownList1.Items[1];


Me.radDropDownList1.SelectedItem = Me.radDropDownList1.Items(1)

In this article