O'Reilly logo

ASP.NET by Example by Steven A. Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with the Items Collection

The Items collection is a special property of type ListItemCollection in the System.Web.UI.WebControls namespace and is shared by all ASP.NET list controls. This class does the grunt work in managing the list items for each list control. Table 6.2 shows a summary of the properties and methods for the ListItemCollection class. Please take a moment to review them before we move on with an example of manipulating the items in a list control programmatically.

Table 6.2. Summary of the Properties and Methods of the ListItemCollection Class
Name Item Description
Add Method Overloaded. Adds a new item to the collection by supplying either a ListItem object or string value
All Property Gets an array of type ListItem

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required