Freigeben über


How to: Add and Configure an ObjectList Control 

Use an ObjectList control to display a list or table of data objects.

To add an ObjectList control to an ASP.NET mobile Web page

  1. Drag an ObjectList 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, select the DataSource property and use the drop-down list to choose a bindable data source.

    For additional information about bindable data sources, see Using Data Binding with ASP.NET Mobile Controls.

  3. In the Properties window, click the ellipsis button (ASP.NET Mobile Designer ellipse) in the Fields box.

  4. In the ObjectList Properties dialog box, create new fields or select existing fields using the Field Name list.

  5. Using the DataField drop-down list, bind the ObjectList field to a field in the data source.

  6. To format the output, specify a format string in the DataFormatString box.

    For more information about .NET Framework format strings, see Formatting Overview.

  7. In the Title box, enter the title or label that the application will display for the field name

  8. Click OK.

To apply a command to an ObjectList control

  1. In the Properties window, click the ellipsis button in the Commands box.

  2. In the Property Builder dialog box, click Create new command and enter a name for the new command.

  3. In the Text box, enter the text that the application uses to render the Command control on the device's display.

  4. Repeat steps 2 and 3 until the ObjectList control's commands are all defined.

  5. Click OK to close the Property Builder.

  6. In the Properties window for the ObjectList control, in the drop-down list for the DefaultCommand property, click one of the commands that you defined.

To change a field name on an ObjectList control

  1. In the Properties window, click the ellipsis button (ASP.NET Mobile Designer ellipse) in the Fields box.

    The designer displays the ObjectList Properties dialog box.

  2. In the Field Name list, select the item that you want to change.

  3. Press F2 or click the item again to make the item editable, enter the new name, and then press ENTER.

See Also

Tasks

How to: Add and Configure an ObjectList Control

Concepts

Introduction to the ObjectList Control
Overriding Properties
Data Binding and Viewing Data Using an ObjectList Control
Introduction to the Form Control
Introduction to the Panel Control
Introduction to the List Control
Using Data Binding with ASP.NET Mobile Controls

Other Resources

Using Device Filters
Customizing with Control Templates