List.Decoration 属性

定义

获取或设置用于项的修饰的类型。Gets or sets the type of decoration used for items. 默认值为 NoneThe default value is None. 此 API 已过时。This API is obsolete. 若要了解如何开发 ASP.NET 移动应用,请参阅 ASP.NET 移动应用和网站For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 property System::Web::UI::MobileControls::ListDecoration Decoration { System::Web::UI::MobileControls::ListDecoration get(); void set(System::Web::UI::MobileControls::ListDecoration value); };
[System.ComponentModel.Bindable(true)]
public System.Web.UI.MobileControls.ListDecoration Decoration { get; set; }
member this.Decoration : System.Web.UI.MobileControls.ListDecoration with get, set
Public Property Decoration As ListDecoration

属性值

一个枚举值,表示用于项的修饰的类型。An enumerated value representing the type of decoration used for items.

属性

示例

下面的代码示例演示如何使用 Decoration 属性将列表更改为编号列表。The following code example demonstrates how to use the Decoration property to change the list to a numbered list. 属性在 Page_Load 方法的最后一行中进行设置。The property is set in the last line of the Page_Load method. 此示例是 List 概述的一个更大示例的一部分。This example is part of a larger example for the List overview.

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;
    }
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    If Not IsPostBack Then
        ' Set the DataMembers of the List
        List1.DataValueField = "Status"
        List1.DataTextField = "TaskName"

        ' Create an ArrayList of task data
        Dim arr As ArrayList = 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 spec As String = "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
    End If
End Sub

注解

在目标设备允许的位置,可以将列表项与项目符号或编号修饰。Where the target device permits, list items can be undecorated, or decorated with bullets or numbers. ListDecoration 枚举具有以下值: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.

适用于

另请参阅