Telerik UI for Windows Phone by Progress

The RadListPicker control provides the user with an interactive UI, that allows him to select a single item from a list of potential options. This tutorial will help you get started with the control and will explain the following:

Using the RadListPicker control

In order to use the RadListPicker control in your application you have to reference the following assemblies in your project:

  • Telerik.Windows.Controls.Input.dll
  • Telerik.Windows.Controls.Primitives.dll
Note
To use the RadListPicker control in Expression Blend you have to also add a reference to Telerik.Windows.Core.dll.

After adding references to the aforementioned dlls, you can declare a new RadListPicker instance as any normal Silverlight control.

Note

To use the RadListPicker control in the XAML you have to add the following namespace declaration:

xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
CopyXAML
<telerikInput:RadListPicker x:Name="radListPicker" />

Providing a List with Options

The RadListPicker control derives from the HeaderedItemsControl, so it works as any other ItemsControl. In the case of the RadListPicker control the items should represent list of options. After defining such a list you have to set it to its ItemsSource property.

Here is an example of a RadListPicker control that allows the user to choose between countries.

CopyXAML
<telerikInput:RadListPicker x:Name="radListPicker" Header="Country:" VerticalAlignment="Top"></telerikInput:RadListPicker>
CopyC#
List<string> countries = new List<string>() { "United Kingdom", "Germany", "China",
"Japan", "Bulgaria" };
this.radListPicker.ItemsSource = countries;

Inline and Popup Mode

The RadListPicker control can operate in two modes:

  • Inline - in this mode the RadListPicker control gets expanded and shows its items. When the user selects the desired item, the RadListPicker control gets collapsed again and shows only the selected item.
  • Popup - in this mode the RadListPicker control displays a popup window, when clicked. When the user selects the desired item, the popup gets closed and the RadListPicker control displays the selected item.

The mode in which the RadListPicker control runs is determined by the count of its items and the value of the InlineModeTreshold property. When the count of the items is greater, then the InlineItemsTreshold the RadListPicker control runs in Popup mode. Otherwise it runs in Inline mode. The default value of the InlineModeTreshold is 5.

To learn more about the two modes, read the Inline Mode and the Popup Mode topics.

Getting the Selected Item

The selected item is exposed through the SelectedItem property. You can also programmatically control the selection via the SelectionIndex property.