Export (0) Print
Expand All

ObjectList.ViewMode Property

Gets or sets the view mode of an ObjectList. This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site.

Namespace:  System.Web.UI.MobileControls
Assembly:  System.Web.Mobile (in System.Web.Mobile.dll)

[BindableAttribute(false)]
[BrowsableAttribute(false)]
public ObjectListViewMode ViewMode { get; set; }
<asp:ObjectList ViewMode="ObjectListViewMode" />

Property Value

Type: System.Web.UI.MobileControls.ObjectListViewMode
An ObjectListViewMode value representing the view mode of the object list.

ExceptionCondition
Exception

An attempt was made to set this property to a value other than List while no item was selected.

The following options are available for this property through the ObjectListViewMode enumeration.

Member Name

Description

List

This is the default view displayed when the page containing the object list is rendered for the first time. It consists of either the label fields of the items, or if the TableFields property is not empty, a table with columns corresponding to the table fields and rows for the items. In HTML, this view is combined with the Commands view, with the commands appearing as hyperlinks below the list. When there is more information in the Details view, a hyperlink for each item displaying the Details view is rendered.

Details

In HTML, this view is combined with the Commands view, with the commands appearing as hyperlinks below the details.

Commands

This view is rendered separately only for WML devices. It consists of a menu with the commands of the ObjectList. For HTML devices, the List view and Details view are each combined with this view, with the commands appearing as hyperlinks below the details or list.

NoteNote

To set this property in code, an item in the list must be selected before setting this property to Commands or Details view. An attempt to set the property before selecting an item throws an exception.

A view mode is persisted in a private view state, so that, regardless of whether the EnableViewState property of the ObjectList object is true, the view mode is persisted as a private field. However, if the EnableViewState property is false, the items collection is not persisted between requests, requiring a data bind to be repeated for each request.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft