On Thu, 26 May 2005 10:19:24 -0400, Peter D. Dunlap
[quoted text, click to view] <pdunlap@NOSPAMfcsg.com> wrote:
>(Sounds like a Harry Potter title or something...)
>
>After much searching and fiddling, I have finally got a working
>DataGridComboBoxColumn and the associated DataGridComboBox control,
>and they seem to work well, except for two odd things:
>
>(1) If you are entering a value in the combo box on the new row, and
>this causes another new row to be created, the first combo box event
>disappears. If you open the dropdown and click a selection with the
>mouse, the new row gets created and the combo box goes back to its
>original selection. Same for if you hit a key to make the selection -
>the first time creates the new row, and the next time you can actually
>select something.
>
>(2) The arrow keys do not work within the combo box to make
>selections. The F4 key will open the selection list, but if you hit
>the down arrow key it will move you to the next grid row and collapse
>the select list.
>
>Does anyone have a solution for either of these problems?
>
> Pete Dunlap
More information on item (1) which is more important to figure out:
I go to the combo box on the new row and select an item. The
following things happen:
(a) In the ComboBox control, OnSelectionChangeCommitted happens, and
the selected index at that point is correct for the item I picked.
(b) The Edit function in the column style class is called.
(c) In the ComboBox control, OnSelectedIndexChanged happens, and the
selected index is now -1.
I'm not sure where to look to figure out what's happening. I've got
custom versions of the DataGrid, the column style and the ComboBox so
I can put debugging code anywhere in there, I just don't know where to
look next. (I've even got source for the system classes courtesy of
Reflector, but the DataGrid class in particular is huge...)