This documentation is archived and is not being maintained.

Introduction to the ObjectList Control

ObjectList controls display multiple views of data collections such as databases. Each item, or object, in an object list can be thought of as a record in a database. Like database records, objects in an ObjectList control contain fields. Each field stores data. Applications must use data binding to fill an object list with data. If you need your application to create a list of static items, use the List control.

The ObjectList control provides multiple views of the data to which it is bound. One view is a summary-style tabular list of objects. The table contains a row of data for each object. The columns show field values. In addition, ObjectList controls display a detailed view of each record. This view includes the values in every field that is publicly available. Developers are able to customize both of these views. This can be done both programmatically and with the ObjectList control's Property Builder dialog box.

An ObjectList control must be placed within a Form or Panel control, or within a control's template. After you add an ObjectList control to a container or template, sample items are displayed until you specify the object list's data binding.

Applications can bind ObjectList controls to a DataView or DataSet object, or any other object that implements the IEnumerable interface. When an ObjectList control performs data binding, it can automatically generate the fields displayed for the list items. For more information, see the Initiating Automatic Field Generation During Data Binding section in the ObjectList class topic.

The ObjectList control supports device-specific customization through property overrides and templates.

In addition, applications can attach custom commands to each object in an ObjectList control. To define commands, use the Property Builder for ObjectList controls. The ASP.NET Mobile Designer adds the <Command> markup tag to the HTML file. When the user selects a command, the ObjectList control raises an ItemCommand event. Your application can provide a handler method for this event to further customize the control's behavior.

See Also

ObjectList Control | Adding and Configuring an ObjectList | Overriding Properties | Customizing with Control Templates | Introduction to the Form Control | Introduction to the Panel Control | Introduction to the List Control | Using Data Binding