RadComboBox Enter Key Problem

1 posts, 0 answers
  1. Aram
    Aram avatar
    1 posts
    Member since:
    Oct 2013

    Posted 07 Oct 2013 Link to this post


     I have a radcombobox control that gets filled with data on page load ( at code behind ) and I have a rad button on the page, that has a clientclicking event on it, inside this event, I read the selected value of the radcombobox , using jquery selector, and do some validation on it.

    The problem is happening whenever I start typing (filtering) inside the radcombobox then pressing the enter key to select the item, it is clearing the selected value of the control, so whenever I read the selected value of the radcombobox after pressing the enter key to select the item, the value gets displayed as empty string. It is working fine if I select an item using a normal mouse click.

    The markup for the radcombobox is:

    <rad:RadComboBox ID="lstEntity" runat="server" Width="95">

    The code used to fill the radcombobox is:

    With lstEntity
           .DataSource = _Entities.EntityCodes.OrderBy(Function(o) o)
           .Items.Insert(0, New Telerik.Web.UI.RadComboBoxItem("- Select -", "0"))
    End With

    The code used in the rad button's ClientClicking event to read the selected value of the radcombobox is:

    var selectedEntity = $find($("[id$='lstEntity']")[0].id).get_value();

    Therefore, the selectedEntity is being filled  with an empty string, whenever I select an item from the radcombobox through an enter key. As a note, the get_text() function always returns the correct selected text, regardless of the way I use to select the item (mouse click or Enter key).

    So I am not sure if this is an issue with the control itself, or it is in the way I am binding the data with control or even reading the selected value. I would appreciate it if someone can help me.

Back to Top