List.Decoration Property

Definition

Gets or sets the type of decoration used for items. The default value is None. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

C#
[System.ComponentModel.Bindable(true)]
public System.Web.UI.MobileControls.ListDecoration Decoration { get; set; }

Property Value

An enumerated value representing the type of decoration used for items.

Attributes

Examples

The following code example demonstrates how to use the Decoration property to change the list to a numbered list. The property is set in the last line of the Page_Load method. This example is part of a larger example for the List overview.

C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        // Set the DataMembers of the List
        List1.DataValueField = "Status";
        List1.DataTextField = "TaskName";

        // Create an ArrayList of task data
        ArrayList arr = new ArrayList();
        arr.Add(new Task("Define transactions", "scheduled"));
        arr.Add(new Task("Verify transactions", "scheduled"));
        arr.Add(new Task("Check balance sheet", "scheduled"));
        arr.Add(new Task("Compile balance sheet", "scheduled"));
        arr.Add(new Task("Prepare report", "scheduled"));
        arr.Add(new Task("Send report", "scheduled"));

        // Bind the array to the list
        List1.DataSource = arr;
        List1.DataBind();

        const string spec = "Start: {0} tasks are done, {1} " +
           "tasks are scheduled, and {2} tasks are pending.";
        Label2.Text = String.Format(spec, doneCount, +
            schedCount, pendCount);

        List1.Decoration = ListDecoration.Bulleted;
    }
}

Remarks

Where the target device permits, list items can be undecorated, or decorated with bullets or numbers. The ListDecoration enumeration has the following values:

Name Description
None No decoration.
Bulleted List items are decorated with a bullet.
Numbered List items are decorated with a number.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also