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

combobox focus does not work in IE8

8 Answers 109 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
juan
Top achievements
Rank 1
juan asked on 20 Oct 2010, 11:03 PM
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.

8 Answers, 1 is accepted

Sort by
0
juan
Top achievements
Rank 1
answered on 20 Oct 2010, 11:06 PM
RadComboBox1.Focus()

no function en IE8, But in firefox and chrome its working.
0
Accepted
Helen
Telerik team
answered on 22 Oct 2010, 03:54 PM
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
0
juan
Top achievements
Rank 1
answered on 22 Oct 2010, 05:31 PM
ok thaks its work with ScriptManager1.SetFocus(RadComboBox1.ClientID + "_Input")
0
ken
Top achievements
Rank 1
answered on 10 Mar 2011, 10:44 AM

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!

 

0
Helen
Telerik team
answered on 16 Mar 2011, 01:21 PM
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!
0
ken
Top achievements
Rank 1
answered on 16 Mar 2011, 02:28 PM

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.

0
Helen
Telerik team
answered on 16 Mar 2011, 04:51 PM
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!
0
ken
Top achievements
Rank 1
answered on 17 Mar 2011, 07:20 AM
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")
Tags
ComboBox
Asked by
juan
Top achievements
Rank 1
Answers by
juan
Top achievements
Rank 1
Helen
Telerik team
ken
Top achievements
Rank 1
Share this question
or