Click here to Skip to main content
14,736,835 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
I have a data grid view which is used to bind values, I have a combo box inside this data grid view, I want to implement an auto complete property in this combo box... It should not only search for the first letter but the whole item...

What I have tried:

I have looked for the codes since the combo box is inside the data grid view, I cannot seems to find a solution
Updated 10-Apr-16 11:26am

1 solution

Hi Sajin

Have you tried using EditingControlShowing event of the Datagridview?

if (e.Control is DataGridViewComboBoxEditingControl) //check for the id in case multiple columns with dropdown and you need specific.
                ((ComboBox)e.Control).DropDownStyle = ComboBoxStyle.DropDown;
                ((ComboBox)e.Control).AutoCompleteSource = AutoCompleteSource.ListItems;
                ((ComboBox)e.Control).AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;

Hope this helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900