List.ItemDataBind Event
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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;
public event System.Web.UI.MobileControls.ListDataBindEventHandler ItemDataBind;
member this.ItemDataBind : System.Web.UI.MobileControls.ListDataBindEventHandler
Public Custom Event ItemDataBind As ListDataBindEventHandler
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;
}
}
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
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.
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: