I have my webcombo configured to ComboTypeAhead = Suggest and EnaleXmlHttp = true.
When the grid is displayed I can click a row with the mouse. The value is displayed in the combo and the grid closes. Now, if I change the selected row using the keyboard arrows and then press enter, there is a postback. Is there a way to cancel that postback?
Thanks.
Yes, this took me some time to figure out as well. Here is what I got working on my case - the idea is to handle the EditKeyDown event and check the keyCode - if it is 13 (Enter), close the dropdown and the return true to cancel the postback.
<script language="javascript"> function keyDown(combo, newValue, keyCode) { if (keyCode == 13) { var combo = igcmbo_getComboById(combo); combo.setDropDown(false); return true; } } </script> <igcmbo:WebCombo ID="WebCombo1" runat="server" DataSourceID="AccessDataSource1"> <ClientSideEvents EditKeyDown="keyDown" />
Hope this helps.
Hello Rumen.
Thanks for the answer. That's exactly what I needed.