Window as Dialog

2 posts, 0 answers
  1. Stephen Arnold
    Stephen Arnold avatar
    4 posts
    Member since:
    Jan 2010

    Posted 19 Nov 2010 Link to this post

    I am using the RadWindow as a dialog functionally it works fine for everything I am doing. There are two more cosmetic things I want to do and I am having trouble with them.

    1. I want to set the initial focus to a textbox in the window. I have tried this in a javascript, form tag, and in the page load on the code behind and neither has worked:

    javascript:

     

     

    var templateName = document.getElementById("txtTemplateName");

     

    templateName.focus();


    code behind:

    txtTemplateName.Focus();

    form tag:

     

    <

     

     

    form id="form1" method="post" runat="server" defaultfocus="txtTemplateName">

     

     

     

     


    2. I want to make a button on the window the default button and allow the enter key to press the button. I have set the button as the default button in the form tag and it appears to make it the default, but I press enter and the window clears all input, but it doesn't run the code for the button, then if I reenter the input and click the button with the mouse I get javascript errors.

    form tag:

    <

     

     

    form id="form1" method="post" runat="server" defaultbutton="btnOK" >

     


    Thank you in advance for your help.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 22 Nov 2010 Link to this post

    Hi Stephen,

    What I would suggest is to make sure that your logic works when the content page is displayed in an IFRAME. Once it does, load it in a RadWindow with ShowContentDuringLoad=true and you should get the same behavior there as well.

    Kind regards,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jumpstart 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