System.Web.UI.WebControls Namespace ListItemCollection Class
Removes all ListItem objects from the collection.
[ VB ] Public Sub Clear ( ) [ C# ] public void Clear ( ); [ C++ ] public: void Clear ( ); [ JScript ] public function Clear ( );
Use the Clear method to remove all ListItem objects in the ListItemCollection.
NOTE: The Count property is automatically set to 0 after this method is used.
The following example demonstrate how to use the Clear method to empty the ListItemCollection before adding new items to the collection.
myList.Items.Clear ( );
myList.Items.Clear ( )
ListItemCollection Members Add AddAt AddRange Insert Remove RemoveAt
Check out related books at Amazon
© 2025 Reynald Nuñez and asp.net.ph. All rights reserved. If you have any question, comment or suggestion about this site, please send us a note