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

set focus on a button

1 Answer 49 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 07 Dec 2012, 11:21 AM
How can i set focus on a button which is inside contenttemplate of radwindow? 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Dec 2012, 11:48 AM
Hi Sigma,

Following is the sample code that I tried to set focus to a button inside the RadWindow.

ASPX:
<telerik:RadWindow VisibleOnPageLoad="true" OnClientShow="OnWindowShow" ID="RadWindow3" runat="server" Height="300px" Width="450px" Modal="true">
    <ContentTemplate>
        <asp:Button ID="Button1" runat="server"  OnClick="Button1_Click" />/>
    </ContentTemplate>
</telerik:RadWindow>

JS:
<script type="text/javascript">
    var obj;
    function pageLoad() {
        obj = $get("<%=Button1.ClientID %>");
    }
    function OnWindowShow(sender, args) {
        setTimeout(" obj.focus();", 200);
    }
</script>

Regards,
Shinu.
Tags
Window
Asked by
Sigma
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or