This is a migrated thread and some comments may be shown as answers.

Backspace key in RadCombobox

8 Answers 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tri Nguyen
Top achievements
Rank 1
Tri Nguyen asked on 24 Nov 2010, 06:12 PM
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    This is the first page.<br />
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default2.aspx">Go to page with combobox</asp:HyperLink>
  
    </div>
    </form>
</body>
</html>
  
  
  
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
    <div>
            Hitting the Backspace key after selecting an item here will redirect back to Default
            <telerik:RadComboBox ID="RadComboBox1" runat="server">
            <Items>
                <telerik:RadComboBoxItem Value="0" Text="Item 0" />
                <telerik:RadComboBoxItem Value="1" Text="Item 1" />
                <telerik:RadComboBoxItem Value="2" Text="Item 2" />
                <telerik:RadComboBoxItem Value="3" Text="Item 3" />
            </Items>
            </telerik:RadComboBox>
    </div>
    </form>
</body>
</html>
I am sure this has been addressed before, but I couldn't find any reference for it. So, here is the problem I found: when an item in a radcombox is selected, if you hit the backspace key, you will be redirected to the previous page. Below is my code: Starting from Default.aspx page, click on the hyperlink to Default2.aspx; selecting any of the items in the Radcombobox, hit the backspace key and you go back to Default.aspx.

Hopefully, it would be a simple solution to fix this. Thanks.

Tri Nguyen

8 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 25 Nov 2010, 09:59 AM
Hi Tri Nguyen,

Please check this help article - it explains how to fix the issue.

Kind regards,
Yana
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Tri Nguyen
Top achievements
Rank 1
answered on 25 Nov 2010, 07:30 PM
So, I have to do that for EVERY single radcombobox on the form? And everytime I modify the page, adding and removing any radcombobox, I would have to modify the script to reflect the changes, right? This seems to be a work-around more than a "fix"! Will you have the fix for this issue any time soon or this happens by design?
0
Yana
Telerik team
answered on 26 Nov 2010, 10:22 AM
Hello Tri Nguyen,

Actually we have plans to research this issue but we cannot tell exact timeframe for this. We're sorry for the caused inconvenience.

Best wishes,
Yana
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Shweta
Top achievements
Rank 1
answered on 25 Jan 2013, 01:25 PM
I am facing the same kind of issue. Can you please post the fix for this?
0
dhuss
Top achievements
Rank 1
answered on 25 Jan 2013, 04:11 PM
The fix listed in this issue is for the browser back arrow, not the actual backspace key (decimal 8 keycode). I have found that if the combobox's allow custom text = false and the user places the cursor in the box and hits the backspace key, it behaves the same as the browser back arrow. It the combobox allow custom text = true, then this behavior doesn't happen. Have there been any fixes to this since telerik.web.ui.dll version 2011.3.1305.35
0
Hristo Valyavicharski
Telerik team
answered on 30 Jan 2013, 01:16 PM
Hi Dennis,

The suggested workaround works only for some of the browsers. This beahvior with pressing backspace key or back arrow differs for different browsers and even for different versions. At the moment there is no standard or specification for this. Note that there are issues with all ajax applications and Back button. 

Storing the value of the combo could be implemented in many ways. Cookies, Hidden fields, Local Storage. Here is a sample using Local Storage. Latest version of all modern browsers support Local Storage

<telerik:RadComboBox ID="RadComboBox1"
     runat="server"
     OnClientSelectedIndexChanged="onSelectedIndexChanged">
     <Items>
         <telerik:RadComboBoxItem runat="server" Text="Red" Value="red" />
         <telerik:RadComboBoxItem runat="server" Text="Blue" Value="blue" />
         <telerik:RadComboBoxItem runat="server" Text="Green" Value="Green" />
     </Items>
 </telerik:RadComboBox>
 
 <asp:Button ID="Button1" runat="server" Text="Button that Redirects" />
 <script type="text/javascript">
     function pageLoad() {
         var savedValue = localStorage.getItem('RadComboBox1');
         var combo = $find('<%= RadComboBox1.ClientID %>');
 
         if (savedValue != "" && combo.findItemByValue(savedValue)) {
             combo.findItemByValue(savedValue).select();
         }
     }
 
     function onSelectedIndexChanged(sender, eventArgs) {
         localStorage.setItem('RadComboBox1', eventArgs.get_item().get_value());
     }
 </script>
Other option is to have your own "Back" button on a page which allows to make cross page posting. Also in the upcoming Q1 2013 there will be new Persistence Framework. It will allow users to preserve their settings between sessions by saving the state of any RadControl on the page in a file, database or any other storage. It will give you the ability to also save any other types of settings.

Kind regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Brian
Top achievements
Rank 1
answered on 06 Mar 2013, 09:34 PM
Hi All,

The article suggested by Yana (above) does not work for me (IE 10). Instead, I have found How to Prevent Backspace Key from Navigating Backwards to work consisting. I hope Telerik will resolve this issue soon.

Thanks
0
Hristo Valyavicharski
Telerik team
answered on 11 Mar 2013, 04:58 PM
Hi Brian,

Thank you for sharing this post with the community. We are looking for new ways to improve the current behavior in order to become more user friendly.

Kind regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Tri Nguyen
Top achievements
Rank 1
Answers by
Yana
Telerik team
Tri Nguyen
Top achievements
Rank 1
Shweta
Top achievements
Rank 1
dhuss
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Brian
Top achievements
Rank 1
Share this question
or