المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Need help with DataGridView combobox Editing please



C# Programming
11-20-2009, 05:00 PM
Hello.

I have a Datagrid which is bound to a dataset. One of the columns I have changed to ComboBoxColumn. This is bound to a column in the dataset. I read that you can change a combobox dropdown style to dropdown in order to make it editable. I can do this with a normal combobox but I can't work out how to do it with a combobox within a datagridview.

What I am trying to achieve is having a combobox that is editable, meaning that you can type something in the box that isn't in the bound list. I am wanting it to also autofill if what is typed matches what is in the bound list. If it is not in the bound list I am wanting to be able to add to the list what was typed in. (add a new row to the dataset).

So basically a field that you can choose from a list or type in your own. This of course is bound to a dataset which in turn will add to the underlying table in the database.

I am using Visual Studio 2008