This is a migrated thread and some comments may be shown as answers.

Close window and refresh datalist

1 Answer 173 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 21 May 2008, 01:03 AM

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.

Regards,

Jon

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 May 2008, 11:41 AM
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() 
    GetRadWindow().close(); 

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
Tags
Window
Asked by
Jon
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or