C1PickerView Control

The C1PickerView control allows users to select a single item from a list of options. The nearest equivalent to the C1PickerView control in the ASP.NET Toolbox is the DropDownList control, but there are distinct differences between the two in appearance. Instead of setting items in a drop-down list, the C1PickerView control places items in a slot-machine-style list that users can rotate by touching the iPhone screen. In the center of the picker, there is a gray overlay that indicates the current selection. When the picker selection is changed, the SelectedIndexChanged event is raised.

The following diagram illustrates the elements of a C1PickerView control:

 

 

Multiple pickers can be added to the C1PickerView control, and each picker list object will be represented by the C1Picker class. The image below illustrates a C1PickerView control with multiple picker lists:

 

C1PickerView List Types

A C1PickerView control can contain two types of lists: a numbered range list or an itemized list. To specify a numbered range, set the PickerType property to NumberRange; to specify an itemized list, set the PickerType property to DependsOnItems. A numbered range will automatically populate the picker lists with a range of numbers, and you can establish the range of numbers by setting the NumberRangeStart and NumberRangeEnd properties. An itemized list will have no items by default, so you will have to add them in Source view or in code.

C1PickerView Events and States

To make the C1SwitchButton control perform an action when the user selects an item, you can either use the server-side SelectedIndexChanged event or the client-side OnClientSelectedIndexChanged event of the C1SwitchButton control. The control also features a server-side SelectedIndexChanging event and a client-side OnClientSelectedIndexChanging event that fires before the selected index of the control changes.

When the user turns the picker wheel, the state of C1Picker's SelectedIndex property will change. You can use this property to determine which list item a user has chosen.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.