List.ItemDataBind Event

Definition

Occurs when an item in a List is bound to data. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public event System.Web.UI.MobileControls.ListDataBindEventHandler ItemDataBind;

Event Type

Examples

The following code example demonstrates how to use the ItemDataBind event to get the starting totals of status settings for the list. This code is part of a larger example for the List overview.

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;
    }
}

Remarks

When an item in a List is created and data-bound, this event handler sets the properties of the list item from arbitrary expressions. An item in a List is of type MobileListItem. This event is raised as each data source item is bound. This is the best time to filter or group items in the MobileListItemCollection collection, by using the Text or Value Property.

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