This documentation is archived and is not being maintained.

ListItemCollection Methods

The methods of the ListItemCollection class are listed here. For a complete list of ListItemCollection class members, see the ListItemCollection Members topic.

Public Methods

public methodAdd Overloaded. Appends a ListItem to the end of the collection.
public methodAddRange Adds the items in an array of ListItem objects to the collection.
public methodClear Removes all ListItem objects from the collection.
public methodContains Determines whether the collection contains the specified item.
public methodCopyTo Copies the items from the ListItemCollection to the specified System.Array, starting with the specified index.
public methodEquals (inherited from Object) Overloaded. Determines whether two Object instances are equal.
public methodFindByText Searches the collection for a ListItem with a Text property that contains the specified text.
public methodFindByValue Searches the collection for a ListItem with a Value property that contains the specified value.
public methodGetEnumerator Returns a System.Collections.IEnumerator implemented object that contains all ListItem objects in the ListItemCollection.
public methodGetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
public methodGetType (inherited from Object) Gets the Type of the current instance.
public methodIndexOf Determines the index value that represents the position of the specified ListItem in the collection.
public methodInsert Overloaded. Inserts a ListItem in the collection at the specified index location.
public methodRemove Overloaded. Removes a ListItem from the collection.
public methodRemoveAt Removes the ListItem at the specified index from the collection.
public methodToString (inherited from Object) Returns a String that represents the current Object.

Protected Methods

protected methodFinalize (inherited from Object) Overridden. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

In C# and C++, finalizers are expressed using destructor syntax.

protected methodMemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

ListItemCollection Class | System.Web.UI.WebControls Namespace

Show: