RadComboBox focus problem

5 posts, 0 answers
  1. Dinesh
    Dinesh avatar
    13 posts
    Member since:
    May 2008

    Posted 09 Feb 2011 Link to this post

    Hi,

    I have a  form with RadComboBox. I have set EmptyMessage for RadComboBox. I need to keep that ComboBox focused when the page is loaded and start typing.

    I tried followings.

    in Page load event

    1.
    this.Form.DefaultFocus = RadComboBox1.ClientID;

    2.
    RadAjaxManager am = RadAjaxManager.GetCurrent(this);
     
    am.FocusControl(RadComboBox1.ClientID + "_Input");
    RadScriptManager1.SetFocus(RadComboBox1);


    In 1st method RadComboBox is focused but EmptyMessge is not cleared. when we type, "EmptyMessage" also remains.

    In 2nd method all work fine only in IE. but not in FireFox or Chrome.

    Can anybody help regarding this matter ?.

    Thank you,

    Dinesh 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Feb 2011 Link to this post

    Hello Dinesh,

    You could achieve the desired behavior from client side.For that you need to
    • Get the client-side instance of the combobox
    • Get the DOM element of the input field
    • Focus the input field 
    Please check this help article which which explains more on this.

    Thanks,
    Shinu.
  3. Dinesh
    Dinesh avatar
    13 posts
    Member since:
    May 2008

    Posted 09 Feb 2011 Link to this post

    Hi Shinu,

    Thank you for the reply. I saw the url you send. In my case focusing works. "EmptyMesage" remain even the RadComboBox is focused and cursor is blinking in front of the "empty message" we need to delete EmptyMessage each time.

    I resolve this with javascript. On document load. I set the value of INPUT (gen from RadComboBox) to blank. 

    window.onload = function () {
        var cid = "<%=CmbItems.ClientID %>" + "_Input";
        var input = document.getElementById(cid);
     
        input.value = "";
    }


    Is there any better solution for this ?

    Thank you,

    Dinesh
  4. Charles Embling
    Charles Embling avatar
    2 posts
    Member since:
    Sep 2004

    Posted 16 Jun 2011 Link to this post

    Dinesh,

    Did you ever get this resolved?

    I applied the same work around however I have a problem in IE.

    On page load, I set focus to the radComboBox (that is within a user control) from a content page.  Everything works fine but when i start typing in IE, the first character I type is cleared out along with the Empty Message (BAD). 

    In Chrome, the first character I type is NOT cleared (GOOD).

    I love Chrome and hate IE, but my customers all use IE still. 

    Thanks,
    Chuck.
  5. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 23 Jun 2011 Link to this post

    Hello Charles,

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

    Greetings,
    Helen
    the Telerik team

    Browse the vast support resources we have to jump start 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.

Back to Top