Datagridview Editable Combobox

M

Murali

Hi,

i have a datagridview with one column set as combobox. the combobox is
bound to a dataset. now i want to able to type in the combobox. i did
this with changing the style of the combo to drop down. but when enter
the data and pressing tab the text disappears from the cell. can
anybody help me with this.

this is my code

Private Sub DataGridView1_EditingControlShowing(ByVal sender As
Object, ByVal e As
System.Windows.Forms.DataGridViewEditingControlShowingEventArgs)
Handles DataGridView1.EditingControlShowing
cb = CType(e.Control, ComboBox)
If Not cb Is Nothing Then
cb.DropDownStyle = ComboBoxStyle.DropDown
AddHandler cb.SelectedValueChanged, AddressOf cb_SelectedIndexChanged

End If
End Sub


Thanks and regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top