How to pass value from child window to parent window

4 posts, 0 answers
  1. Raghavendra
    Raghavendra avatar
    2 posts
    Member since:
    Sep 2010

    Posted 14 Sep 2010 Link to this post

    How to pass value from child window to parent window when the child window is closed ?
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 17 Sep 2010 Link to this post

    Hi Raghavendra,

    you can attach a handler to the OnClientBeforeClose event of the RadWindow and assign a custom parameter to the RadWindow object itself. the handler should be declared on the page which is opened in the RadWindow control. These are the basic steps that you need to implement:
    • Attach a the handler (for example, name the handler RadWindowBeforeCloseHandler)  based on this Code Library article
    • Implement the handler as shown bellow:
      function RadWindowBeforeCloseHandler(oWindow, args)
      {
          oWindow.MyCustomParameter = "Some Value";
      }
    • Finally, you can get the value of the custom property using the OnClientClose handler:
      function RadWindowBeforeCloseHandler(oWindow, args)
      {
         var passedParam = oWindow.MyCustomParameter;
         alert(passedParam); // alerts "Some Value"
      }
    I hope this helps.


    Best wishes,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Pranitha Jugge
    Pranitha Jugge avatar
    2 posts
    Member since:
    Mar 2019

    Posted 20 Mar Link to this post

    Hi Fiko,

    I have the similar scenario.

    1. There is Parent Page, which shows list collections and provides a edit link to each one.

    2. When you click on Edit link, it will open a radwindow(EditRadWindow) which contains multiple radgrids in it based on data collections type.

    3.This EditRadWindow provides a feature of adding new data to existing list of data. When you click on this Add link, it will again open a radwinow(AddRadWindow). 

    4. I will provide some data at AddRadWindow and click on submit button, then it should pass the data to ParentWindow's corresponding grid before closing itself.

     

    Can you please provide any solution for it.

  4. Vessy
    Admin
    Vessy avatar
    2068 posts

    Posted 25 Mar Link to this post

    Hi Pranitha,

    You can see how to refer both the parent page of RadWindow from its content page and vice versa in this help article:
    https://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/calling-functions-in-windows

    You can also find useful sample on a similar matter in the following code library:
    https://www.telerik.com/support/code-library/creating-parent-child-relationships-between-radwindows-and-passing-data-between-them

    Regards,
    Vessy
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top