Setting Focus when RadWindow Closes

2 posts, 0 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 02 Sep 2010 Link to this post

    Hi..
    I have a button that opens a RadWindow.  When the window closes I need to setfocus to a textbox.

    I've tried  txtBox.Focus() before calling the RadWindow and after - but the cursor never seems to go into the textbox.

    Any ideas?  thanks again
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Sep 2010 Link to this post

    Hello Jon,


    If you want  to set focus to the asp:TextBox on parent page, then the better approach is attaching the "OnClientClose" event to the RadWindow and invoking the focus() method in the handler.

    Check out the sample code.

    Mark-up:

    <
    telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="combobx.aspx"
     OnClientClose="setFocus">
    </telerik:RadWindow>


    JavaScript:
    function setFocus()
    {
        var txtbx=document.getElementById("TextBox1");
        txtbx.focus();
    }


    Regards,
    Shinu.
Back to Top