System.Web.UI.WebControls.ListItemCollection Class

A collection of System.Web.UI.WebControls.ListItem objects in a list control. This class cannot be inherited.

See Also: ListItemCollection Members


[System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ListItemsCollectionEditor, System.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public sealed class ListItemCollection : IList, System.Web.UI.IStateManager


The System.Web.UI.WebControls.ListItemCollection class represents a collection of System.Web.UI.WebControls.ListItem objects. The System.Web.UI.WebControls.ListItem objects, in turn, represent the items displayed in list controls, such as the System.Web.UI.WebControls.ListBox. To programmatically retrieve System.Web.UI.WebControls.ListItem objects from a list control, use one of following methods:

The ListItemCollection.Count property specifies the total number of items in the collection, and is commonly used to determine the upper bound of the collection. You can add and remove items from the collection by using the ListItemCollection.Add(string) and ListItemCollection.Remove(string) methods.


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,