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

Destroying Preview Window on Close

1 Answer 73 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 15 Mar 2012, 09:59 PM
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();
            oWindowManager.add_show(addShowHandler);
            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.

Thanks,
Chris

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 20 Mar 2012, 10:42 AM
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.

Greetings,
Dobromir
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.
Tags
FileExplorer
Asked by
Chris
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or