Rad window close,refreshing parent window.

2 posts, 1 answers
  1. Rama
    Rama avatar
    22 posts
    Member since:
    Jun 2012

    Posted 22 Jun 2012 Link to this post

    Hello All,

    I am opening a rad window in the asp.net grid row command . It is working properly .

    codebase:
    in the command:
      Telerik.Web.UI.RadWindow objwindow = new Telerik.Web.UI.RadWindow();

                        objwindow.VisibleOnPageLoad = true;
                        objwindow.NavigateUrl = "~/OfferManagement/CreateCounterOffer.aspx?OfferId=" + _commandArg;
                        double heightwinc = 400;
                        double widthwinc = 900;
                        objwindow.Height = new Unit(heightwinc);
                        objwindow.Width = new Unit(widthwinc);
                        pnlradData.Controls.Add(objwindow);

    in the aspx page:

    <asp:Panel ID="pnlradData" runat="server"></asp:panel>


    The issue is, I want to refresh the parent window after closing that  dynamically created "objwindow"(rad window) . I searched across the google but I didn't find a correct solution for it.Can I add any event? Please help me.

    Thanks

    Rama.M


  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jun 2012 Link to this post

    Hi Rama,

    You can hook the OnClientColose to the RadWindow and refresh the page using document.location.reload().

    C#:
    Telerik.Web.UI.RadWindow objwindow = new Telerik.Web.UI.RadWindow();
    objwindow.VisibleOnPageLoad = true;
    objwindow.OnClientClose = "RefreshParentPage";
    objwindow.NavigateUrl = "~/OfferManagement/CreateCounterOffer.aspx?OfferId=" + _commandArg;
    double heightwinc = 400;
    double widthwinc = 900;
    objwindow.Height = new Unit(heightwinc);
    objwindow.Width = new Unit(widthwinc);
    pnlradData.Controls.Add(objwindow);

    JS:
    <script type="text/javascript">
        function RefreshParentPage()//function in parent page
        {
            document.location.reload();
        }
    </script>

    This function should be placed in the parent page - where your RadWindow / RadWindowManager is.

    Hope this helps.

    Thanks,
    Princy.
Back to Top