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

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

GridColumnStylesCollection.AddRange メソッド

スタイル オブジェクト配列コレクション追加します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub AddRange ( _
    columns As DataGridColumnStyle() _
)
Dim instance As GridColumnStylesCollection
Dim columns As DataGridColumnStyle()

instance.AddRange(columns)
public void AddRange (
    DataGridColumnStyle[] columns
)
public:
void AddRange (
    array<DataGridColumnStyle^>^ columns
)
public void AddRange (
    DataGridColumnStyle[] columns
)
public function AddRange (
    columns : DataGridColumnStyle[]
)

パラメータ

columns

コレクション追加する DataGridColumnStyle オブジェクト配列

使用例使用例

DataGridColumnStyle オブジェクト配列作成しAddRange メソッド使用して、その配列を GridColumnStylesCollection に追加するコード例次に示します

Private Sub AddStyleRange()
    ' Create two DataGridColumnStyle objects.
    Dim col1 As New DataGridTextBoxColumn()
    col1.MappingName = "FirstName"
    Dim col2 As New DataGridBoolColumn()
    col2.MappingName = "Current"
       
    ' Create an array and use AddRange to add to collection.
    Dim cols() As DataGridColumnStyle = {col1,
 col2}
    dataGrid1.TableStyles(0).GridColumnStyles.AddRange(cols)
End Sub
private void AddStyleRange()
{
   // Create two DataGridColumnStyle objects.
   DataGridColumnStyle col1 = new DataGridTextBoxColumn();
   col1.MappingName = "FirstName";
   DataGridColumnStyle col2 = new DataGridBoolColumn();
   col2.MappingName = "Current";


   // Create an array and use AddRange to add to collection.
   DataGridColumnStyle[] cols = new DataGridColumnStyle[2] {col1,
 col2};
   dataGrid1.TableStyles[0].GridColumnStyles.AddRange(cols);
}
void AddStyleRange()
{
   
   // Create two DataGridColumnStyle objects.
   DataGridColumnStyle^ col1 = gcnew DataGridTextBoxColumn;
   col1->MappingName = "FirstName";
   DataGridColumnStyle^ col2 = gcnew DataGridBoolColumn;
   col2->MappingName = "Current";
   
   // Create an array and use AddRange to add to collection.
   array<DataGridColumnStyle^>^cols = {col1,col2};
   dataGrid1->TableStyles[ 0 ]->GridColumnStyles->AddRange( cols );
}
private void AddStyleRange()
{
    // Create two DataGridColumnStyle objects.
    DataGridColumnStyle col1 = new DataGridTextBoxColumn();
    col1.set_MappingName("FirstName");
    DataGridColumnStyle col2 = new DataGridBoolColumn();
    col2.set_MappingName("Current");

    // Create an array and use AddRange to add to collection.
    DataGridColumnStyle cols[] = new DataGridColumnStyle[] { col1,
 col2 };
    dataGrid1.get_TableStyles().get_Item(0).get_GridColumnStyles().
        AddRange(cols);
} //AddStyleRange
function AddStyleRange(dataGrid: DataGrid)
{
   // Create two DataGridColumnStyle objects.
   var col1: DataGridColumnStyle = new DataGridTextBoxColumn();
   col1.MappingName = "FirstName";
   var col2: DataGridColumnStyle = new DataGridBoolColumn();
   col2.MappingName = "Current";

   // Create an array and use AddRange to add to collection.
   var cols: DataGridColumnStyle[] = [col1, col2];
   dataGrid.TableStyles[0].GridColumnStyles.AddRange(cols);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GridColumnStylesCollection クラス
GridColumnStylesCollection メンバ
System.Windows.Forms 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS