I'm using a RadComboBox. I have AllowCustomText = "true" and Filter = "Contains" as shown below:
I'm interested in the behavior that occurs when the user does
not select an item, but presses the Enter key.
Initially, I found that when the user types text, but doesn't select an item from the matching list, then presses Enter, it raises the OnClientSelectedIndexChanged event. That's not a problem for my situation. However, I noticed that when the user types text that
exactly matches
an item from the matching list (complete word or phrase and case-sensitive), but doesn't select the matching item from the matching list, then presses Enter the
OnClientSelectedIndexChanged event is not raised. This caused a problem for my situation.
I then added the OnClientTextChange event handler. Now if the user enters text that exactly matches an item in the list, doesn't select the item, then presses enter, the OnClientTextChange event will be raised. But if the user enters text that doesn't exactly match, then doesn't select an item, then presses enter, the
OnClientSelectedIndexChanged event is still raised.
To test the above situation, just add the following javascript:
You'll find that if you type "tes", then press Enter, the ClientSelectedIndexChanged event will be raised. If you type "test", then press Enter, the ClientTextChange event will be raised.
Raising the
OnClientSelectedIndexChanged event when the user doesn't make a selection is an interesting occurrence itself. The event not being raised if the text exactly matches an item is equally interesting. Since this is all interesting, my question is, is this behavior by design? Is it not likely to change in future releases? I can make it work fine. I just wanted to make sure that's the way Telerik intended and to let other users know this works this way.
Thanks!