DataGridViewComboBoxColumn.MaxDropDownItems プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewComboBoxColumn.MaxDropDownItems プロパティの意味・解説 

DataGridViewComboBoxColumn.MaxDropDownItems プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

内のセルドロップダウン リスト表示する項目の最大数を取得または設定します

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

Public Property MaxDropDownItems As
 Integer
Dim instance As DataGridViewComboBoxColumn
Dim value As Integer

value = instance.MaxDropDownItems

instance.MaxDropDownItems = value
public int MaxDropDownItems { get;
 set; }
public:
property int MaxDropDownItems {
    int get ();
    void set (int value);
}
/** @property */
public int get_MaxDropDownItems ()

/** @property */
public void set_MaxDropDownItems (int
 value)
public function get MaxDropDownItems
 () : int

public function set MaxDropDownItems
 (value : int)

プロパティ
ドロップダウン リストの項目の最大数 (1 ~ 100)。既定値は 8 です。

例外例外
例外種類条件

InvalidOperationException

CellTemplate プロパティの値が null 参照 (Visual Basic では Nothing) です。

解説解説

このプロパティ取得または設定すると、CellTemplate プロパティによって返されるオブジェクトの MaxDropDownItems プロパティ取得または設定できます。このプロパティ設定すると、列に含まれるすべてのセルMaxDropDownItems プロパティ設定されます。セル指定した値をオーバーライドするには、列の値を設定してからセルの値を設定します

使用例使用例

DataGridViewComboBoxColumn を使用してTitleOfCourtesy 列へのデータ入力円滑化するコード例次に示します

Private Shared Sub SetAlternateChoicesUsingItems(
 _
    ByRef comboboxColumn As DataGridViewComboBoxColumn)

    With comboboxColumn
        .Items.AddRange(New String() _
                {"Mr.", "Ms.",
 "Mrs.", "Dr."})
    End With
End Sub

Private Function CreateComboBoxColumn() _
    As DataGridViewComboBoxColumn
    Dim column As New DataGridViewComboBoxColumn()

    With column
        .DataPropertyName = ColumnName.TitleOfCourtesy.ToString()
        .HeaderText = ColumnName.TitleOfCourtesy.ToString()
        .DropDownWidth = 160
        .Width = 90
        .MaxDropDownItems = 3
        .FlatStyle = FlatStyle.Flat
    End With
    Return column
End Function
private static void SetAlternateChoicesUsingItems(
    ref DataGridViewComboBoxColumn comboboxColumn)
{
    {
        comboboxColumn.Items.AddRange(
            new string[] { "Mr.",
 "Ms.", "Mrs.", "Dr." });
    }
}

private DataGridViewComboBoxColumn CreateComboBoxColumn()
{
    DataGridViewComboBoxColumn column =
        new DataGridViewComboBoxColumn();
    {
        column.DataPropertyName = ColumnName.TitleOfCourtesy.ToString();
        column.HeaderText = ColumnName.TitleOfCourtesy.ToString();
        column.DropDownWidth = 160;
        column.Width = 90;
        column.MaxDropDownItems = 3;
        column.FlatStyle = FlatStyle.Flat;
    }
    return column;
}
private:
    void SetAlternateChoicesUsingItems(
        DataGridViewComboBoxColumn^% comboboxColumn)
    {
        {
            comboboxColumn->Items->AddRange(
                gcnew array<String^> { "Mr.", "Ms.", "Mrs.",
 "Dr." });
        }
    }

private:
    DataGridViewComboBoxColumn^ CreateComboBoxColumn()
    {
        DataGridViewComboBoxColumn^ column =
            gcnew DataGridViewComboBoxColumn();
        {
            column->DataPropertyName = ColumnName::TitleOfCourtesy.ToString();
            column->HeaderText = ColumnName::TitleOfCourtesy.ToString();
            column->DropDownWidth = 160;
            column->Width = 90;
            column->MaxDropDownItems = 3;
            column->FlatStyle = FlatStyle::Flat;
        }
        return column;
    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewComboBoxColumn クラス
DataGridViewComboBoxColumn メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewComboBoxColumn.CellTemplate プロパティ
DataGridViewComboBoxCell クラス
DataGridViewComboBoxCell.MaxDropDownItems プロパティ



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

辞書ショートカット

すべての辞書の索引

「DataGridViewComboBoxColumn.MaxDropDownItems プロパティ」の関連用語

DataGridViewComboBoxColumn.MaxDropDownItems プロパティのお隣キーワード
検索ランキング

   

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



DataGridViewComboBoxColumn.MaxDropDownItems プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS