Close Window from Formview

4 posts, 0 answers
  1. bslaght
    bslaght avatar
    184 posts
    Member since:
    Jun 2006

    Posted 06 Mar 2008 Link to this post

    I have a formview inside my radwindows.  After Insert or Cancel is clicked I want the window to close and the parent to refresh.

    How do I go about this?
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Mar 2008 Link to this post

    Hello bslaght,

    You can hook to the OnClientClose event of the RadWIndow and use document.location.reload() or document.location.href = document.location.href to reload / refresh the page.

    e.g.
    <script type="text/javascript">
    function OnClientClose(sender,args)
    {
    //your code here
    }
    </script>
    <telerik:radwindow id="RadWindow1" runat="server" OnClientClose="OnClientClose" />




    Best wishes,
    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. bslaght
    bslaght avatar
    184 posts
    Member since:
    Jun 2006

    Posted 08 Mar 2008 Link to this post

    Hi Georgi,
     That answers the refresh part of my question however, I still don't know how to force the window to close when I click insert on cancel on my formview.

    I know I will need to hook into my formview itemcommand, but i don't know what to code in there to close my rad window.  Please advise.

  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Mar 2008 Link to this post

    Hello bslaght,

    If I understand you correctly, you wish to close the RadWindow after you do some processing on the server from the content page (that is displayed in the RadWindow), am I right?

    If this is so, I suggest to check the following KB article
    http://www.telerik.com/support/kb/article/b454K-gtd-b454T-cec-b454c-cec.aspx

    There you can see how to call Javascript code from the server in several scenarios - this example closely matches your case. You only need to replace the radalert calling function with the one that closes the RadWindow - GetRadWindow().close() (You must have the GetRadWindow() function declared on your content page before that).

    I hope this helps.


    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top