Declined
Last Updated: 28 Oct 2014 14:53 by ADMIN
ADMIN
Danail Vasilev
Created on: 24 Jun 2013 09:02
Category: ComboBox
Type: Bug Report
1
FIX Pressing Enter key in RadComboBox does not trigger the Default Button in IE and Chrome
Selecting an item from the RadComboBox and then pressing Enter key, does not trigger the default button(if set) of the form/panel in IE and Chrome. The workaround is to handle the client-side OnClientKeyPressing event of the RadComboBox and manually trigger the clicking of the default button.For example:

ASPX:

    <asp:Panel ID="Panel1" runat="server" DefaultButton="RadButton1">
        <telerik:RadTextBox ID="RadTextBox1" runat="server">
        </telerik:RadTextBox>
        <asp:Label ID="Label1" Text="" runat="server" />
        <telerik:RadButton ID="RadButton1" runat="server" OnClick="OnClick1" Text="Click" />
        <telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientKeyPressing="OnClientKeyPressing">
            <Items>
                <telerik:RadComboBoxItem Text="text1" Value="val1" />
                <telerik:RadComboBoxItem Text="text2" Value="val2" />
                <telerik:RadComboBoxItem Text="text3" Value="val3" />
            </Items>
        </telerik:RadComboBox>
    </asp:Panel>

JavaScript:
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OnClientKeyPressing(sender, args) {

                if (args.get_domEvent().keyCode == 13) {
                    $find("<%=RadButton1.ClientID %>").click();
                }
            }
        </script>
    </telerik:RadCodeBlock>
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
ADMIN
Peter Filipov
Posted on: 28 Oct 2014 14:53
Hello,

In case that we implement the requested feature we will introduce a breaking change in the RadComboBox's behavior. That's why we recommend to use the described implementation for that kind of scenarios.

Regards,
Peter