System.Web.UI.WebControls.ListItemCollection.Insert Method

Inserts a System.Web.UI.WebControls.ListItem which represents the specified string in the collection at the specified index location.

Syntax

public void Insert (int index, string item)

Parameters

index
The location in the collection to insert the System.Web.UI.WebControls.ListItem.
item
A string that represents the item to insert in the collection.

Remarks

Use the ListItemCollection.Insert(int, string) method to add a System.Web.UI.WebControls.ListItem to the collection at the index specified by the index parameter. This implementation of the method creates a System.Web.UI.WebControls.ListItem to represent the text specified by the item parameter. The ListItem.Text property of the new System.Web.UI.WebControls.ListItem has the value item, and the ListItem.Value property has the value null. This System.Web.UI.WebControls.ListItem is then inserted in the collection at the specified index.

Requirements

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