Placing a ComboBox onto a DataGridView Cell.

  • Thread starter Thread starter AndyNakamura
  • Start date Start date
A

AndyNakamura

Guest
I'm working on an application where users can enter data via a datagridview.
Some of the columns need to display a combobox so the user can select from particular values.
I've got this working, to a fashion, but there are things that bug me.
The application works by placing a combobox over the datagridview cell when the focus gets to a particular row, so that the user can select from the drop down list. After a value is selected it copies that to the datagrid cell.
The application works fine if I only use the mouse for selecting cell. If I use the TAB key I have to tab twice on some columns. If I don't move off the cell that is being edited, then the value is not saved, (I guess because endedit has not been called).
Anyway the code is a tyranny of fudges. It must be way more complicated than it needs to be.

So, my question. Does anyone know of a working example of this sort of application in vb.net or even c#?
I’ve searched high and low trying to find something.
I’ve found bits of stuff like using ProtectedOverides etc but no full implementation, of what seems to me to be a pretty fundamental requirement. Many professional applications seem to take this approach.
I didn't want to use a combobox column as I don't think it looks very good.
To be honest, I last worked on this three years ago and gave up. On looking at it again I was surprised how well it worked, but it's not right.

Continue reading...
 
Back
Top