편집

다음을 통해 공유


ListItemCollection.Insert Method

Definition

Inserts a ListItem in the collection at the specified index location.

Overloads

Insert(Int32, String)

Inserts a ListItem which represents the specified string in the collection at the specified index location.

Insert(Int32, ListItem)

Inserts the specified ListItem in the collection at the specified index location.

Insert(Int32, String)

Inserts a ListItem which represents the specified string in the collection at the specified index location.

public:
 void Insert(int index, System::String ^ item);
public void Insert (int index, string item);
member this.Insert : int * string -> unit
Public Sub Insert (index As Integer, item As String)

Parameters

index
Int32

The location in the collection to insert the ListItem.

item
String

A String that represents the item to insert in the collection.

Remarks

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

See also

Applies to

Insert(Int32, ListItem)

Inserts the specified ListItem in the collection at the specified index location.

public:
 void Insert(int index, System::Web::UI::WebControls::ListItem ^ item);
public void Insert (int index, System.Web.UI.WebControls.ListItem item);
member this.Insert : int * System.Web.UI.WebControls.ListItem -> unit
Public Sub Insert (index As Integer, item As ListItem)

Parameters

index
Int32

The location in the collection to insert the ListItem.

item
ListItem

The ListItem to add to the collection.

Remarks

Use the Insert method to add a ListItem to the collection at the index specified by the index parameter. This implementation of the method takes the ListItem specified by the item parameter and inserts it in the collection at the specified index.

See also

Applies to