Freigeben über


How to: Add and Configure a SelectionList Control 

Use a SelectionList control to display a selectable list of items.

NoteNote

The appearance of a SelectionList control varies widely, depending on the type of list chosen and the display capabilities of the device being used to browse the application.

To add a SelectionList control to an ASP.NET mobile Web Forms page

  1. Drag a SelectionList control from the Mobile Web Forms tab of the Toolbox onto a Form or Panel control, or inside a control's template on a mobile Web page. You can also drag it onto a mobile user control page.

  2. In the Properties window, use the drop-down list next to the SelectType property to choose the type of SelectionList to use.

  3. Optionally add items to the list by clicking the ellipsis button (ASP.NET Mobile Designer ellipse) in the Items property and entering the items with the SelectionList Properties dialog box.

  4. Optionally add items to the list through data binding using the DataMember, DataSource, DataTextField, and DataValueField properties.

  5. If needed, set the appearance of the SelectionList control with the Alignment, Font, ForeColor, and StyleReference properties in the Properties window.

  6. Configure the appearance of the SelectionList control for specific devices as needed using these steps:

    1. Apply device filters by clicking the ellipsis button in the AppliedDeviceFilters box, which displays the Applied Device Filters dialog box.

    2. Click the ellipsis button in the PropertyOverrides in the Properties box, which displays the Property Overrides dialog box to set property values for specific types of devices.

To change an item on a SelectionList control

  1. Click the ellipsis button in the Items property, which displays the SelectionList Properties dialog box.

  2. Select the item that you want to change.

  3. Press F2 or click the item. Either of these actions makes the item editable.

  4. Type the new text for that item and press ENTER.

See Also

Reference

SelectionList

Concepts

Introduction to the SelectionList Control
Overriding Properties
Introduction to the Form Control
Introduction to the Panel Control
Introduction to the ObjectList Control
Using Data Binding with ASP.NET Mobile Controls

Other Resources

Using Device Filters