List.Decoration Propriedade

Definição

Obtém ou define o tipo de decoração usado para itens. O valor padrão é None. Esta API está obsoleta. Para obter informações sobre como desenvolver aplicativos móveis ASP.NET, consulte Aplicativos Móveis & Sites com 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; }
[<System.ComponentModel.Bindable(true)>]
member this.Decoration : System.Web.UI.MobileControls.ListDecoration with get, set
Public Property Decoration As ListDecoration

Valor da propriedade

Um valor enumerado que representa o tipo de decoração usado para itens.

Atributos

Exemplos

O exemplo de código a seguir demonstra como usar a Decoration propriedade para alterar a lista para uma lista numerada. A propriedade é definida na última linha do Page_Load método . Este exemplo faz parte de um exemplo maior para a List visão geral.

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

Comentários

Quando o dispositivo de destino permite, os itens de lista podem ser não decorados ou decorados com marcadores ou números. A ListDecoration enumeração tem os seguintes valores:

Nome Descrição
None Sem decoração.
Bulleted Itens de lista são decorados com um marcador.
Numbered Itens de lista são decorados com um número.

Aplica-se a

Confira também