I have a combobox with a datagrid, but I’d like the user to be able to type into the combobox like usual; At the minute it’s a fixed dropdown. Here is my code:
Dim NewColumn As New DataGridViewComboBoxColumn() 'Declare new DGV CC
With NewColumn 'Set Properties
.DataPropertyName = "NewColumn" 'Name
.HeaderText = "New Column" 'Heading
.DropDownWidth = 160 'Width Of DropDown Box
.Width = 90 'Display Width
'.MaxDropDownItems = 5 'How Many Items To Drop Down At A Time
.FlatStyle = FlatStyle.Flat 'Appearance
.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox
.Items.Add("Screw Fix 1") 'Add Some Text Items
.Items.Add("Fix 1")
.Items.Add("3 Stone")
.Items.Add("34 Stone")
.Items.Add("5")
.Items.Add("6")
.Items.Add("7")
.Items.Add("8")
.Items.Add("9")
.Items.Add("10")
End With
dgDetails.Columns.Add(NewColumn) 'Add The Column
There isn’t natively you need to handle two events
The first to allow the user to type in the new value
The second to actually insert the new value