Hey guys. I have a problem entering a new item in my combo box. If the combobox is close and I start entering a letter, that letter is highlighted and the grid drops down. Because of this, a user might have a problem when they want to enter a new record, the will end up typing a word and be missing the first letter. Keep in mind that if the combo box is already open, the letters will go in normally with the usual autoCompleteMode.
Hello Legasy,
Thank you for posting your question to the Infragistics WinGrid Forums. I created the attached sample using your information from above and was unable to reproduce the described issue.
Please take a look at this sample and let me know if this issue persists.
Sincerely,Mike D.Developer Support EngineerInfragistics, Inc.
Sorry for the long wait.
I realised there is something is. There is a TextChanged eventHandler for the UltraCombo. It goes like this
static void ddl_EnterAndTextChanged(object sender, EventArgs e)
{
UltraCombo ddl = (UltraCombo)sender;
ddl.PerformAction(UltraComboAction.Dropdown);
}
Should this cause it to highlight the first character when the UltraCombo has been dropdowned?
You can set the SelectionStart and SelectionLength on the control. The problem, I think, will be in finding the right place to do it. I'm not sure it will work in the code you have here, because the combo might be changing these after the event has completed. It's worth a try, though - I could be wrong.
thanks a lot mike. Actually the autoCompleteMode was not set at first which gave rise to the first letter being highlighted. When I set the autoCompleteMode to SuggestAppend as you did, I had the first two letters being highlighted just like you.
I will submit the request like you suggested however I would like to ask one more thing. Is there a way to not have the letter(s) highlighted? possibly move the cursor on the highlighted text all the way to the right? That would solve the current issue.
I took a look at the sample Mike attached above. It sounds to me like you are using AutoCompleteMode = SuggestAppend, rather than Suggest as his sample is using.
So I changed that, and I added a handler for TextChanged like you have here. Your code is clearly intended to keep the dropdown dropped down at all times while the user is typing. This seems reasonable, but I'm not sure it's compatible with the SuggestAppend mode.
Anyway, when I run the sample, I type the letter "a". This works fine, the combo drops down, which it would have done even without the TextChanged code, and it shows "ActiveBorder" with everything bu the first "A" highlighted.The list shows all the items that begin with "A". So far, so good.
Now I type a "b". This time, the comb text changes to "ab". Wince there is no "ab" on the list, the combo closes up at this point. That's the behavior fo the SuggestAppend style. The TextChanged event then fires and the combo re-opens, which ends up selecting all of the text, so the entire "ab" is now selected.
I don't see any way to do what you are trying to do here. Unless maybe you could somehow detect when this occurs and fix the selection afterward. It seems to me that the SuggestAppend mode is just incompatible with keeping the dropdown open all the time. Perhaps you should Submit a feature request to Infragistics and ask for a new style that is like SuggestAppend except it keeps the combo open all the time?