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

Setting Focus when RadWindow Closes

1 Answer 139 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 02 Sep 2010, 02:31 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Sep 2010, 07:26 AM
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.
Tags
Window
Asked by
Jon
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or