Close a radwindow from within itself

4 posts, 0 answers
  1. IrishManInUSA
    IrishManInUSA avatar
    27 posts
    Member since:
    Jun 2008

    Posted 15 Jul 2008 Link to this post

    I have a form that opens up a dialog which will allow the user to do some things, and once they are done, they can click on a button and the window will close.

    Well, it is suppose to close, but I have gotten it to close yet. So I was wondering how you would go about doing that?
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 16 Jul 2008 Link to this post

    Hello John Daly,

    In general, you need to get a reference to the content page's wrapper - e.g. the RadWindow that shows the content page, and then to call its close() method.

    More information on the subject and a code sample is available in the following help article: Using RadWindow as a Dialog.

    I hope this helps.


    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paulo
    Paulo avatar
    5 posts
    Member since:
    Sep 2007

    Posted 19 Apr 2009 Link to this post

    Path to the example is not working. I have the same problem
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Apr 2009 Link to this post

    Hello Paulo,

    Try the following client side code for clossing RadWindow onclicking the button which is placed in the dialog window.

    Dialog Page:
    [ASPX]
     
    <input id="Button1" type="button" value="Close the window" onclick="coseWindow();" /> 

    [JavaScript]
     
    <script type="text/javascript">  
    function coseWindow()  
    {  
        var oWindow = GetRadWindow();  
        oWindow.close();  
    }  
    function GetRadWindow()  //To get a reference to the RadWindow object   
    {  
      var oWindow = null;  
      if (window.radWindow)  
         oWindow = window.radWindow;  
      else if (window.frameElement.radWindow)  
         oWindow = window.frameElement.radWindow;  
      return oWindow;  
    }    
    </script> 
    Using RadWindow as a Dialog

    Thanks,
    Princy.
Back to Top