Items Property (ObjectList)
Returns the collection of items in an ObjectListItemCollection list. The default value is an empty collection.
public virtual
System.Web.UI.MobileControls.ObjectListItemCollection Items {
get
}
Remarks
You can inspect the items in the ObjectListItemCollection collection, but you cannot modify the collection.
Example
The following example demonstrates how to use the Items property of the ObjectList control.
Public Sub DeleteItem(sender as Object, e as ObjectListSelectEventArgs)
e.UseDefaultHandling = false
dim arr as ArrayList
arr = CType(Session("Arr"),ArrayList)
arr.RemoveAt(ObjectList1.Items.IndexOf(e.ListItem))
ObjectList1.DataSource = arr
ObjectList1.DataBind()
End Sub
[C#]
void DeleteItem(Object sender, ObjectListSelectEventArgs e)
{
e.UseDefaultHandling = false;
ArrayList arr = new ArrayList();
arr = (ArrayList)Session["Arr"];
arr.RemoveAt(ObjectList1.Items.IndexOf(e.ListItem));
ObjectList1.DataSource = arr;
ObjectList1.DataBind();
}
See Also
Applies to: ObjectList Class