Paul Keister
Paul Keister

Reputation: 13097

Effective auto-complete for WinForms DataGridViewComboBoxColumn

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?

Upvotes: 0

Views: 823

Answers (1)

Hasani Blackwell
Hasani Blackwell

Reputation: 2056

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.

Upvotes: 1

Related Questions