I have a combobox on a form that is loaded server side. When I type the name of a person in the combobox, it highlights the name in the dropdown and also completes the name in the text area. But, when I hit the enter key it isn't selecting the item. I have an OnClientKeyPressing event set to handle the keystrokes and check for the enter key. But, the get_value() is blank. But, If I actually click on the item in the dropdown, then the get_value() returns a value.
If the items is found in the dropdown, and is highlighted in the dropdown list and autocompletes the text field, why isn't it selecting that item and allowing me to get the value for it with the get_value() method?
If the items is found in the dropdown, and is highlighted in the dropdown list and autocompletes the text field, why isn't it selecting that item and allowing me to get the value for it with the get_value() method?
<
telerik:RadComboBox
ID
=
"CustomerSearch"
runat
=
"server"
Width
=
"180"
Height
=
"160"
MarkFirstMatch
=
"true"
AllowCustomText
=
"true"
CssClass
=
"CustomerSearch" AutoPostBack="true"
EnableVirtualScrolling
=
"true"
ShowMoreResultsBox
=
"true"
OnTextChanged
=
"CustomerSearch_TextChanged"
OnSelectedIndexChanged
=
"CustomerSearch_SelectedIndexChanged"
OnClientKeyPressing
=
"HandleKeyPress"
EmptyMessage
=
"Enter last, first to search..."
BackColor
=
"White"
Skin
=
"Forest"
/>
<
script
type
=
"text/javascript"
>
function HandleKeyPress(sender, args) {
if (args.get_domEvent().keyCode == 13) {
//this alert message is not null. it is an empty string.
alert(sender.get_value());
}
}
</
script
>