編集を有効にした datagridviewcomboboxcolumn を持つ datagridview があります。これは、列に datapropertyname が設定されていない限り機能します。
datapropertyname が設定されていて、コンボボックスに入力しているときに、項目が適切に提案されますが、ENTER を押すと、以前に選択した項目が再び選択されます。
Enter キーを押した後に datapropertyname が設定されていない場合は、提案された項目が選択されます。
編集を有効にする私のコード:
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
If e.Control.GetType Is GetType(DataGridViewComboBoxEditingControl) Then
Dim cb As ComboBox = TryCast(e.Control, ComboBox)
If cb IsNot Nothing Then
cb.DropDownStyle = ComboBoxStyle.DropDown
End If
End If
End Sub