List.Decoration Proprietà

Definizione

Ottiene o imposta il tipo di effetto utilizzato per gli elementi. Il valore predefinito è None. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni ASP.NET per dispositivi mobili, vedere App per dispositivi mobili & Siti con 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

Valore della proprietà

Valore enumerato che rappresenta il tipo di effetto utilizzato per gli elementi.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la Decoration proprietà per modificare l'elenco in un elenco numerato. La proprietà viene impostata nell'ultima riga del Page_Load metodo. Questo esempio fa parte di un esempio più ampio per la List panoramica.

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

Commenti

Se il dispositivo di destinazione consente, gli elementi dell'elenco possono essere annullati o decorati con punti elenco o numeri. L'enumerazione ListDecoration ha i valori seguenti:

Nome Descrizione
None Nessun effetto.
Bulleted L'effetto applicato agli elementi dell'elenco è costituito da un punto elenco.
Numbered L'effetto applicato agli elementi dell'elenco è costituito da un numero.

Si applica a

Vedi anche