<Item> Element 

Represents a single MobileListItem in a List or SelectionList ASP.NET mobile control. <Item> elements can be used to declaratively define the contents of a list.

<Item Text="itemText" Value="itemValue"
   Selected="[ True | False ]" />

Properties

Property Description

Selected

Sets or returns whether the MobileListItem is selected in its parent List or SelectionList object.

Text

Sets or returns the string contents of the list item. If null, this property returns the value of the Value property.

Value

Sets or returns the value of the list item as a string. If null, this property returns the value of the Text property.

Containment Rules

The following controls can contain an <Item> element.

Control Comments

System.Web.UI.MobileControls.List

A List control can contain any number of <Item> elements. Items can be added declaratively, individually in code, or through data binding.

System.Web.UI.MobileControls.SelectionList

A SelectionList control can contain any number of <Item> elements. Items can be added declaratively, individually in code, or through data binding.

An <Item> element cannot contain any child controls or elements.

Remarks

Each <Item> element creates a corresponding object of the class MobileListItem and adds it to the Items collection of the parent List control.

The set of <Item> elements in a list control defines the initial set of items in a list. You can programmatically add, remove, or modify items in the list.

See Also

Concepts

Mobile Controls Reference

Other Resources

Element Reference