次のDataGridView
ように定義された2つの列があります。
Dim col As New DataGridViewColumn
col.DefaultCellStyle.BackColor = Color.FromArgb(&HFFAAAAAA)
col.Name = "Description"
col.MinimumWidth = 80
col.DataPropertyName = "Description"
col.ValueType = GetType(String)
col.ReadOnly = True
col.CellTemplate = New DataGridViewTextBoxCell
S0Grid.Columns.Add(col)
col = New DataGridViewColumn
col.DefaultCellStyle.BackColor = Color.FromArgb(&HFFBBBBBB)
col.Name = "Value"
col.MinimumWidth = 80
col.DataPropertyName = "Value"
col.ValueType = GetType(String)
col.CellTemplate = New DataGridViewTextBoxCell
S0Grid.Columns.Add(col)
位置 Col=1, Row=0 のセルが aComboBox
ではなく a である必要がありTextBox
ます。そのため、次のコードを追加しようとしましたが、機能しません。編集コントロールは TextBox のままです。
Dim cbCell As New
DataGridViewComboBoxCell
cbCell.Items.AddRange([Enum].GetNames(GetType(System.Reflection.BindingFlags)))
S0Grid(1, 0) = cbCell
どうすればこの問題を解決できるか知っていますか?