This is a migrated thread and some comments may be shown as answers.
How to close download window
3 Answers 48 Views
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 2
Adam asked on 16 Sep 2009, 01:01 AM
When I double-click on a file to download it, an empty RadWindow appears.  How to I either prevent this from appearing, or close if after the download begins/finishes?

Thanks,
Ada,

3 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 16 Sep 2009, 03:17 PM
If you take a look at this demo it shows how to force direct downloading - which should take care of the RadWindow problem. It would seem that this javascript is what handles everything when you have defined the onclientfileopen event.

function OnClientFileOpen(oExplorer, args) 
   var item = args.get_item(); 
   args.set_cancel(true); //this prevents the window from opening 
   var docLoc = "Handler.ashx?path=" + item.get_url(); 
   document.location = docLoc; 

That function is just a re-write of the one provided in the demo with all of the checking removed. It will force a download as well so perhaps you just need to use the args.set_cancel(true); line depending on your implementation.
0
Adam
Top achievements
Rank 2
answered on 16 Sep 2009, 11:44 PM
Thanks, that worked!
0
Tervel
Telerik team
answered on 17 Sep 2009, 07:57 AM
Hi Adam,

In addition to what Carl wrote, I'd like to add that the RadFileExplorer features a property (true by default) -
EnableOpenFile (on doubleclick). You can examine the way it behaves in the default demo:
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/default/defaultcs.aspx

One thing you could do - other than using the provided JavaScript - is set this property to false.

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Asked by
Adam
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Adam
Top achievements
Rank 2
Tervel
Telerik team
Share this question
or