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

[Solved] Unable to set the Focus to TexBox Control which is in User Control Which is opened in the RadWindow

1 Answer 86 Views
Window
This is a migrated thread and some comments may be shown as answers.
Satheesh
Top achievements
Rank 1
Satheesh asked on 21 Apr 2008, 09:19 AM
I tried to to set the focus to the Text box control which is inside RadMuitpage View..  Which is opened in Radwindow.


I have set ShowContentDuringLoad property is  to true for radwindow

Eventhough i was not able to set the focus to the textbox. Please address  this issue ASAP.

1 Answer, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 23 Apr 2008, 02:31 PM
Hi Satheesh,

I tried the following code and it works.
Default.aspx:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
      
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="RadWindow1" 
            runat="server" 
            VisibleOnPageLoad="true" 
            NavigateUrl="Content.aspx" 
            ></telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 
    </div> 
    </form> 
</body> 
</html> 
 
Content.aspx:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body onload="document.getElementById('TextBox1').focus();">  
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server"   
        MultiPageID="RadMultiPage1" SelectedIndex="0" 
        > 
            <Tabs> 
                <telerik:RadTab Text="Tab1"></telerik:RadTab> 
                <telerik:RadTab Text="Tab2"></telerik:RadTab> 
                <telerik:RadTab Text="Tab3"></telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="RadMultiPage1" SelectedIndex="0" runat="server">  
            <telerik:RadPageView ID="RadPageView1" runat="server">  
                <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> 
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>      
            </telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView2" runat="server">  
                MultiPage2  
            </telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView3" runat="server">  
            MultiPage3  
            </telerik:RadPageView> 
        </telerik:RadMultiPage> 
          
    </div> 
    </form> 
</body> 
</html> 
 
Once you run it, you will see that Default.aspx contains a RadWindow, which points to the Content.aspx. Content.aspx contains RadMultipage with several textboxes. Once the page is loaded the focus will be set to the TextBox1.

If you still have a problem, please create a simple running project, where the problem can be observed and send it to us. Once we receive it, we will do our best to help you.

All the best,
Petio Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Satheesh
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Share this question
or