List.ItemDataBind イベント

定義

List 内の項目がデータにバインドされたときに発生します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

public:
 event System::Web::UI::MobileControls::ListDataBindEventHandler ^ ItemDataBind;
public event System.Web.UI.MobileControls.ListDataBindEventHandler ItemDataBind;
member this.ItemDataBind : System.Web.UI.MobileControls.ListDataBindEventHandler 
Public Custom Event ItemDataBind As ListDataBindEventHandler 

イベントの種類

次のコード例では、 イベントを ItemDataBind 使用して、リストの状態設定の開始合計を取得する方法を示します。 このコードは、概要の大きな例の List 一部です。

private void Status_DataBinding(object sender, 
    ListDataBindEventArgs e)
{
    // Increment initial counts
    switch (e.ListItem.Value)
    {
        case "done":
            doneCount += 1;
            break;
        case "scheduled":
            schedCount += 1;
            break;
        case "pending":
            pendCount += 1;
            break;
    }
}
Private Sub Status_DataBinding(ByVal sender As Object, _
    ByVal e As ListDataBindEventArgs)

    ' Increment initial counts
    Select Case e.ListItem.Value
        Case "done"
            doneCount += 1
        Case "scheduled"
            schedCount += 1
        Case "pending"
            pendCount += 1
    End Select
End Sub

注釈

内の List 項目が作成され、データバインドされると、このイベント ハンドラーは、任意の式からリスト アイテムのプロパティを設定します。 内の List 項目の型 MobileListItemは です。 このイベントは、各データ ソース項目がバインドされるときに発生します。 これは、 または Value Property を使用Textして、コレクション内の項目をMobileListItemCollectionフィルター処理またはグループ化するのに最適なタイミングです。

適用対象

こちらもご覧ください