Close window and refresh datalist

2 posts, 0 answers
  1. Jack
    Jack avatar
    127 posts
    Member since:
    May 2003

    Posted 20 May 2008 Link to this post

    Hi all,

    I have read the docs and forums but can't find a way to do what I want, which is:- 

    From a “Delete” button fired in the Item_Databound event of a datalist of image galleries, I am opening a RadWindow that passes in the GalleryID.

    The window is then populated with a list of images that will be deleted and there is a “Confirm Delete” button at the bottom.

    When they confirm, the RadWindow shows a list of all of the images that have been deleted.

    So far so good…

    What I want to do now is click a “Close and return” button on the window that will close the RadWindow and also refresh the DataList on the parent page.

    All help most appreciated.



  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 21 May 2008 Link to this post

    Hello Jon,

    To close a RadWindow with code, you need to get a reference to the wrapper by using the GetRadWindow() function and then to call its close method:

    function GetRadWindow() 
      var oWindow = null
      if (window.radWindow) 
         oWindow = window.radWindow; 
      else if (window.frameElement.radWindow) 
         oWindow = window.frameElement.radWindow; 
      return oWindow; 
    function CloseWin() 

    To refresh the DataList, I would suggest to hook to the RadWindow's OnClientClose eventhandler and to write your client code there. For example you can reload the whole page (window.location.href=window.location.href) or you can do an Ajax call that would update the DataList with a server-side function.

    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top