all groups > dotnet windows forms > august 2005 >
You're in the

dotnet windows forms

group:

Tabbing on to a Combobox in a DataGrid


Tabbing on to a Combobox in a DataGrid Dave
8/30/2005 9:48:01 AM
dotnet windows forms:
I have a DataGrid that has a ComboBox for a field.

For simplicity sake
Column 1: Text
Column 2: ComboBox
Column 3: Text

If I "Click" on the cell in column 2 for a pre-existing row, the ComboBox
appears and allows me to select what I want.

Life is Good....

Until...

I am on the cell in column 1 and I try to TAB onto the same exact cell.
The cell briefly gains focus and then it is lost and focus is now on the
cell in Column 3.

To know that I was getting focus for the ComboBox, I added:
this.comboBox.DroppedDown = true;
so I can visibly see the items populated in the ComboBox for that
brief moment.

Any thoughts would be appreciated.

RE: Tabbing on to a Combobox in a DataGrid Dave
9/1/2005 1:03:04 PM
Found the answer:

You have to override:

protected override void WndProc(ref System.Windows.Forms.Message theMessage)

Take a look at this article:
http://www.akadia.com/services/dotnet_combobox_in_datagrid.html

Cheers,
Dave


[quoted text, click to view]
AddThis Social Bookmark Button