ListItemCollection.AddRange メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ListItemCollection.AddRange メソッドの意味・解説 

ListItemCollection.AddRange メソッド

ListItem オブジェクト配列の項目をコレクション追加します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub AddRange ( _
    items As ListItem() _
)
Dim instance As ListItemCollection
Dim items As ListItem()

instance.AddRange(items)
public void AddRange (
    ListItem[] items
)
public:
void AddRange (
    array<ListItem^>^ items
)
public void AddRange (
    ListItem[] items
)
public function AddRange (
    items : ListItem[]
)

パラメータ

items

コレクション追加する項目を格納している ListItem オブジェクト配列

解説解説
使用例使用例
Dim MyListItemCollection As ListItemCollection
 = New ListItemCollection()

' Dimensions an array of ListItems that are used to populate the collection.
    
Dim NewListItemArray(TempDataTable.Count - 1) As
 System.Web.UI.WebControls.ListItem

' Populates the array of ListItems with generic data.
Dim i As Integer
For i = 0 To TempDataTable.Count - 1
    NewListItemArray(i) = New ListItem()
    NewListItemArray(i).Text = "Item " + i.ToString()
    NewListItemArray(i).Value = i.ToString()
Next

' Adds an entire array of ListItem objects to the collection.
MyListItemCollection.AddRange(NewListItemArray)
ListItemCollection myListItemCollection = new ListItemCollection();

// Creates an array of ListItems that are used to populate the collection.
    
System.Web.UI.WebControls.ListItem[] newListItemArray = new ListItem[tempDataTable.Count];

// Populates the array of ListItems with generic data.
for (int i=0; i < tempDataTable.Count; i++)
 {
    newListItemArray[i] = new ListItem();
    newListItemArray[i].Text = "Item " + i.ToString();
    newListItemArray[i].Value = i.ToString();
}

// Adds an entire array of ListItem objects to the collection.
myListItemCollection.AddRange(newListItemArray);
ListItemCollection myListItemCollection = new ListItemCollection();
// Creates an array of ListItems that are used to populate
// the collection.    
System.Web.UI.WebControls.ListItem newListItemArray[] = 
    new ListItem[tempDataTable.get_Count()];
// Populates the array of ListItems with generic data.
for (int i = 0; i < tempDataTable.get_Count();
 i++) {
    newListItemArray.set_Item(i, new ListItem());
    newListItemArray[i].set_Text("Item " + Convert.ToString(i));
    newListItemArray[i].set_Text("Item " + Convert.ToString(i));
    newListItemArray[i].set_Value(Convert.ToString(i));
}
// Adds an entire array of ListItem objects to the collection.
myListItemCollection.AddRange(newListItemArray);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListItemCollection クラス
ListItemCollection メンバ
System.Web.UI.WebControls 名前空間
ListItem クラス
Add
Insert
Remove
RemoveAt
Clear


このページでは「.NET Framework クラス ライブラリ リファレンス」からListItemCollection.AddRange メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からListItemCollection.AddRange メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からListItemCollection.AddRange メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ListItemCollection.AddRange メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ListItemCollection.AddRange メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS