System.Web.UI.WebControls.ListItemCollection.Clear Method

Removes all System.Web.UI.WebControls.ListItem objects from the collection.

Syntax

public void Clear ()

Remarks

Use the ListItemCollection.Clear method to remove all System.Web.UI.WebControls.ListItem objects. The ListItemCollection.Count property is also set to 0.

Note:

When you use this method, all System.Web.UI.WebControls.ListItem objects are removed from the collection. You cannot undo this.

Requirements

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