combobox focus does not work in IE8

9 posts, 1 answers
  1. juan
    juan avatar
    4 posts
    Member since:
    Jun 2010

    Posted 20 Oct 2010 Link to this post

    combobox focus does not work, I want the combobox gets the focus, not working in IE8, but works on firefox and chrome


    help me please.
  2. juan
    juan avatar
    4 posts
    Member since:
    Jun 2010

    Posted 20 Oct 2010 Link to this post

    RadComboBox1.Focus()

    no function en IE8, But in firefox and chrome its working.
  3. Answer
    Helen
    Admin
    Helen avatar
    1052 posts

    Posted 22 Oct 2010 Link to this post

    Hi Juan,

    Please see the following help topic how to focus the RadComboBox:

    http://www.telerik.com/help/aspnet-ajax/focus-combobox-client-side.html


    Greetings,
    Helen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. juan
    juan avatar
    4 posts
    Member since:
    Jun 2010

    Posted 22 Oct 2010 Link to this post

    ok thaks its work with ScriptManager1.SetFocus(RadComboBox1.ClientID + "_Input")
  5. ken
    ken avatar
    24 posts
    Member since:
    Oct 2010

    Posted 10 Mar 2011 Link to this post

    I use the same @Juan,but It 's also work in IE7, Don't work in IE8
    Dim ScriptManager1 As New ScriptManager
    ScriptManager1.Page = Page
    ScriptManager1.SetFocus(cboMaDichVu.ClientID + 
    "_Input")

    Notes: I used <telerik:RadAjaxManager ... and set <
    telerik:AjaxSetting AjaxControlID ="cboMaDichVu">

    So what is difference?
    Thanks for help!

     

  6. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 16 Mar 2011 Link to this post

    Hello Ken,

    The code below works at our side in IE8:

    //aspx:
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadComboBox ID="RadComboBox1" runat="server"
            AllowCustomText="True">
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="N" />
                <telerik:RadComboBoxItem runat="server" Text="S" />
                <telerik:RadComboBoxItem runat="server" Text="E" />
            </Items>
        </telerik:RadComboBox>
     
        <telerik:RadAjaxManager ID="Manager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Button1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
         
        </telerik:RadAjaxManager>
         
        
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
            Text="Focus ComboBox" />

    //vb:

    Protected Sub Button1_Click(sender As Object, e As EventArgs)
        ScriptManager1.SetFocus(RadComboBox1.ClientID + "_Input")
    End Sub

    Does it work at your side?

    Greetings,
    Helen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. ken
    ken avatar
    24 posts
    Member since:
    Oct 2010

    Posted 16 Mar 2011 Link to this post

    I'm sorry, It does not work.
    First, When I add <asp:
    ScriptManager element in my ascx, It's show messeage :"ScriptManager ... unknow element".
    I search around, I down AjaxToolKit.Dll  ver 3.5 (I use .NET framework 3.5).Then include I found 
    asp:ToolkitScriptManager
    and put below on Page_Load

    If(AJAX.IsInstalled()) Then AJAX.RegisterScriptManager() End If

    ..... on Button_Click
        ToolkitScriptManager1.SetFocus(cboMaDichVu.ClientID + 
    "_Input")


    But also not work.

    I use Donetnuke 5.5 & uncheck partial rendering.
    I uncheck Partial Rendering beacause I have used
    telerik:RadAjaxManager
    Thanks for advance.

  8. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 16 Mar 2011 Link to this post

    Hello Ken,

    Could you please send us a sample project which demonstrates the issue to examine it locally?

    Regards,
    Helen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. ken
    ken avatar
    24 posts
    Member since:
    Oct 2010

    Posted 17 Mar 2011 Link to this post

    I have work around my problem.
    When I spend my time for find out solution , I recognize that when event of client javascript excute, then event setfocus of ScriptManager from code behind will be effect.
    So that I try with below code, and It's work at both IE7 & IE8.
    It's look like a double focus but you can replace the focus event by RegisterStartupScript with another event some kind like show alert messenge, focus other control, then finally ScriptManager1.SetFocus will be work.

    Dim script As String
    script = "var comboBox = document.getElementById('" & cboMaDichVu.ClientID & "_Input');"
    script += "comboBox.focus();"
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "script", script, True)
    Dim ScriptManager1 As New ScriptManager
    ScriptManager1.Page = Page
    ScriptManager1.SetFocus(cboMaDichVu.ClientID + "_Input")
Back to Top