Destroying Preview Window on Close

2 posts, 0 answers
  1. Chris
    Chris avatar
    10 posts
    Member since:
    Jan 2012

    Posted 15 Mar 2012 Link to this post

    I have a FileExplorer that I've tagged some extra functionality on so that the preview window loads larger and is resizable. However, when I close this window, it is not destroyed and continues to lurk in the background. I want to destroy it so that if I go to open another window, that window will be the active one and pick up where the previous one left off.

    Here is the code I am using for the extra properties, found in another thread:

    function OnExplorerFileOpen(oExplorer, args)
        if (!args.get_item().isDirectory()) {
            setTimeout(function ()
                var oWindowManager = oExplorer.get_windowManager();
                var previewWindow = oWindowManager.getActiveWindow();
                previewWindow.setSize(800, 500);
            }, 100);   // Some timeout is required in order to allow the window to become active
            // destroy code will go here I hope?

    This is wired to the OnClientFileOpen event on my FileExplorer.

  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 20 Mar 2012 Link to this post

    Hi Chris,

    You can set the DestroyOnClose property to the RadWindowManager integrated in RadFileExplorer using the following code:
    protected void Page_Load(object sender, EventArgs e)
        RadFileExplorer1.WindowManager.DestroyOnClose = true;

    When this property is set to true, the RadWindow's object will be destroyed upon close.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top