I'm trying to decide whether what I'm seeing with the UltraCombo is a bug / feature / just the way it works and I'm hoping someone could give me an explanation of the behavior I'm seeing.
Infragistics version: 13.2.20132.2010
I've attached a sample project that's pretty simple. It's a form that contains an ultra combo, the combo is bound to a data table that contains 2 columns and 5 rows of names. In the keypress event, I've added a line of code that checks to see if the combo is dropped down, if not it does a PerformAction.DropDown so that the combo always drops on typing.
Performing the following steps:
1) type "aasdfasdfadfasdf". The drop down drops, no line is selected because there is no match (makes sense).
2) click the drop down arrow to close up.
3) click the drop down arrow to drop down (the value remains in the text box)
4) click the drop down arrow to close up.
5) now, mouse click into the center of the text field's value so that the cursor is indicated, then type a character
6) the drop down drops, but instead of the character appearing in the middle of the original text, the original text is wiped out and only the typed character remains.
I would expect the typed character to just insert into the text (and that's the behavior I'm hoping for that's not happening). If that's how it's supposed to work, then it seems inconsistent that manually opening / closing the drop down doesn't clear the text as well.
I can go into the background of why this is necessary, but I don't think it's relevant to the question what's going on here and why is it doing what it's doing.
Thanks in advance,
Chris Rowland
Thanks Mike, at least I know why it's doing what it's doing. Unfortunately I don't have much control over which events to use (it's a legacy application) so I'll have to see if I can figure a workaround.
Hi Chris,
When you drop down the combo, all of the text is selected. So what's happening here is that you get the KeyPress event and the combo drops down and selects all of the text. Then the combo continues to process the key you typed and it replaces the entire selection.
I don't see any simple way around this. My advice would be to use the Enter event to drop down the combo instead of KeyDown.