ListItemCollection.Insert 方法

定義

ListItem 插入集合中的指定索引位置。

多載

Insert(Int32, String)

插入 ListItem,它表示集合中指定索引位置上的指定字串。

Insert(Int32, ListItem)

將指定的 ListItem 插入集合中的指定索引位置。

Insert(Int32, String)

插入 ListItem,它表示集合中指定索引位置上的指定字串。

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)

參數

index
Int32

集合中插入 ListItem 的位置。

item
String

String,表示插入集合中的項目。

備註

Insert使用 方法,將 加入 ListItem 至 參數所指定索引處的 index 集合。 這個 方法的實作會建立 來 ListItem 表示 參數所 item 指定的文字。 TextListItem 的 屬性具有 值 item ,而 Value 屬性具有 值 null 。 然後,這會 ListItem 插入集合中指定的索引處。

另請參閱

適用於

Insert(Int32, ListItem)

將指定的 ListItem 插入集合中的指定索引位置。

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)

參數

index
Int32

集合中插入 ListItem 的位置。

item
ListItem

要加入至集合的 ListItem

備註

Insert使用 方法,將 加入 ListItem 至 參數所指定索引處的 index 集合。 這個 方法的實作會採用 ListItem 參數指定的 item ,並將它插入集合中指定的索引處。

另請參閱

適用於