views:

245

answers:

1

I've build a number of WinForms applications that use DataGridView grids with combo box columns. There seems to be a basic flaw in the user interaction for these controls. Typically my audience is made up of business users who what to perform keyboard driven layout, and they expect auto complete selection when they encounter a dropdown control.

I've seen 2 basic problems with this control type:

  1. When the control gets the focus as a tabstop, it doesn't immediately go into auto complete mode, and the user has to fiddle, usually by hitting a space or a couple of keystrokes.
  2. Sometimes the control appears to have an auto-complete selection, but when the tab is hit the selection clears. This is definitely a problem is you have 2 controls in a row within a grid.

I know that one solution is to use a different control library. Before long I expect to be doing live projects with WPF, but there will still be WinForm maintenance for years to come. I've tried many tweaks to the auto-complete and dropdown style settings, but I've never come up with a configuration that really works for poweruser level keyboard based data entry.

Any suggestions?

+1  A: 

Well, for the 1st problem, are you setting DataGridView.EditMode to DataGridViewEditMode.EditOnEnter?

As for the 2nd, if the out of the box editing control for the ComboBox column isn't doing what you want, you can always roll your own using the IDataGridViewEditingControl interface.

hjb417
Don't know how I missed that! It looks like a change in the EditMode has solved the 2nd problem also, but there's still one open issue: if a combo is in the first column and the focus is set to the grid programatically, edit mode is not triggered. This is a new issue that seems to have been affected by the change in EditMode.Thanks for your help!
Paul Keister
Try calling DataGridView.BeginEdit explictly after programmatic focus.
hjb417