9 Answers, 1 is accepted
Cancelling the ClientFileOpen event of the control is actually the only way to prevent the showing of an empty preview window in FileExplorer. Can you elaborate on the exact reason you do not want to do that?
Please note that even if you are canceling the event you can use all data from its arguments in order to open the file into separate window:
problem is I am opening this file from handler.ashx, I use custom database content provider.
Opening my file like this:
public void ProcessRequest(HttpContext context)
Context = context;
if (context.Request.QueryString["path"] == null)
string path = Context.Server.UrlDecode(Context.Request.QueryString["path"]);
var item = DataServer.GetItem(path);
if (item == null) return;
Any way to close that preview window in OnClientFileOpen?
The approach you should use is the same, with the only difference that you will need to pass the item's path to your custom handler:
A similar approach (with a custom handler implementation) is demonstrated in the following online demo:
great! the only problem is now OnClientFileOpen is called also when opening folders, and I don't want to
why is folder treated as file?
almost working :)
Yes, the Client FileOpen event is raised both for files and folders. You can determine the type of the opened item through its isDirectory() method:
Yes, you can increase the size of the file preview window in FileExplore, but it will affect the size of all dialogs in the control as well. Please note that this can be done earlier in the Page_PreRenderComplete event handler:
I have already answered your other ticket on the matter, for convenience I will paste my answer here as well:
The Handler.ashx file use din the referred demo is available in our demos application, available for downloading form your account here:
Once you install the application you will find the handler in a similar location (the version depends on the installed one):
C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q2 2016\Live Demos\FileExplorer\Examples\ApplicationScenarios\FilterAndDownloadFiles
Telerik by Progress