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

Two useful features

9 Answers 273 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Newton
Top achievements
Rank 2
Newton asked on 30 Mar 2009, 11:46 PM
Hello,

I would like to suggest two useful features for FileExplorer:

1-) Integrate the Image Editor in context menu to resize image files.
2-) Add paging support for folders with large number of files.


Kind Regards,
Newton

9 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 02 Apr 2009, 02:47 PM
Hello Newton,

Thank you for the suggestions.

#2 is already on our TODO list with high prioprity.

As for #1 - we plan to extend and further open the RadFileExplorer API to allow for "plugging-in" custom viewers, such as what we have done inside the RadEditor FileBrowser dialogs (e.g ImageManager dialog, for example).


Sincerely yours,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Shaun Peet
Top achievements
Rank 2
answered on 03 Apr 2009, 07:56 PM
Hi Tervel,

Wouldn't it be easier on your end to make it easier on our end to use the ImageManager as a stand-alone control?  And, for that matter, the other FileBrowserDialogs of the RadEditor?

Shaun.
0
Tervel
Telerik team
answered on 06 Apr 2009, 08:19 AM
Hi Shaun,

This is indeed the direction we have taken. First of all, it has been possible for a long time to use the editor's ImageManager outside of RadEditor. The following KB demonstrates that:
http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx

We have also taken a number of steps that will allow for using the DialogOpener control as a separate, independent control which can be configured in a declarative manner. In addition to this, the "communication" between the editor dialogs and the invoking control has been streamlined and unified to use the same API, the same conventions and the same objects. You can expect this functionality to be finalized and documented at some point - which will make it possible to call any RadEditor dialog independent of the editor itself in an easy, straightforward manner.

One last thing - if you wish to have fine-grained control over the server-side events raised by the RadFileExplorer in the ImageManager dialog, I suggest you examine the sample project attached here - standalonedialogserverevents.zip


The code will allow you to attach and execute code when the Upload, Rename, Delete, etc commands of the standalone File Browser dialogs are fired:
  1. Register the external dialog files:
    1. Copy the EditorDialogs folder to the root of the web project
    2. Set imageManager.Parameters["ExternalDialogsPath"] = "~/EditorDialogs/";  in the codebehind
  2. Create a UserControl in the root of your web application for example named customControl.ascx and put the following code in it:

    <%@ Control Language="C#" AutoEventWireup="true" %> 
     
    <script runat="server" type="text/C#"
     
        protected void Page_Load(object sender, System.EventArgs args) 
        { 
            Telerik.Web.UI.RadFileExplorer rfe = (Telerik.Web.UI.RadFileExplorer)this.FindRadControl(this.Page); 
            if (rfe != null
            { 
                rfe.ItemCommand += new Telerik.Web.UI.RadFileExplorerEventHandler(rfe_ItemCommand); 
            } 
        } 
     
        void rfe_ItemCommand(object sender, Telerik.Web.UI.RadFileExplorerEventArgs e) 
        { 
            string command = e.Command; 
            //throw new Exception(e.Command); 
        } 
     
        private Control FindRadControl(Control parent) 
        { 
            foreach (Control c in parent.Controls) 
            { 
                if (c is Telerik.Web.UI.RadFileExplorer) return c; 
                if (c.Controls.Count > 0) 
                { 
                    Control sub = FindRadControl(c); 
                    if (sub != nullreturn sub; 
                } 
            } 
            return null
        } 
     
    </script> 

    Here the string command = e.Command; will return the executed command name when the command is executed. You can implement and execute your code inside the  rfe_ItemCommand() function.
  3. Register the custom control in the \EditorDialogs\FileBrowser.ascx external dialog control:
    <%@ Register TagPrefix="custom" TagName="customControl" Src="~/customControl.ascx"  %> 
    <custom:customControl ID="customControl1" runat="server" />  


Best wishes,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Shaun Peet
Top achievements
Rank 2
answered on 06 Apr 2009, 02:23 PM
Hi Tervel,

I appreciate the provided sample.  I've been using the FileBrowserDialogs outside of the RadEditor for years, but the Q1 2009 release broke a lot of my old code; particularly when it came to the Document Manager; therefore I quickly had to come up with my own file selector dialog using a FileExplorer - to which I've had varying degrees of success (posted here).  I had a look at the new KB article and there's alot of new js involved when opening the Document Manager - most of which I think is *not* necessary when opening an Image Manager (seems to work without it, anyway):

Document Manager:
    var args = new Telerik.Web.UI.EditorCommandEventArgs("DocumentManager"nulldocument.createElement("a"));  
    args.CssClasses = [];  
      
    $find('<%= DialogOpener1.ClientID %>').open('DocumentManager', args);  

Image Manager:
    $find('<%= DialogOpener1.ClientID %>').open('ImageManager);

In any case, I think you guys may be underestimating just how many people are using the Dialogs outside of the RadEditor (since they're so extremely useful) and need to call more attention to breaking changes.

I am available to help out whenever possible.  Thanks,

Shaun.
0
Shaun Peet
Top achievements
Rank 2
answered on 06 Apr 2009, 02:32 PM
Also, the KB article has, in the aspx, a <telerik:DialogOpener... />.  Visual Studio tells me that I should be using a <telerik:RadDialogOpener... /> instead.  Is there anything different between the two, other than the name?
0
Tervel
Telerik team
answered on 09 Apr 2009, 07:08 AM
Hello Shaun,

There is no difference - the RadDialogOpener cotnrol simply inherits from the DialogOpener control without adding additional features. The reason for this is that the two controls reside in different namespaces - as mentioned earlier, we plan to add more features and expose the RadFileOpener as a full-blown member of the RadControls suite. This is why it has  to be in the Telerik.Web.UI namespace - but for backwards compatibility the original control was also kept.


All the best,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 24 Jun 2009, 10:40 PM
Hi Tervel,

When using code similar to your rfe_ItemCommand example, I only receive "Update" commands, all other actions, which you mention, do not seem to be wired in to the server-side ItemCommand event. Are there in fact more events related to the event or am I missing a setting or specific configuration to handle the other events you mention?

Best,
Michael
0
Lini
Telerik team
answered on 25 Jun 2009, 10:44 AM
Hi Michael,

The possible command names for the File Explorer's ItemCommand server event are: UploadFile, MoveFile, MoveDirectory, CreateDirectory, DeleteDirectory, DeleteFile. Other file explorer actions will not raise the ItemCommand event. I am not sure what you mean by "Update" commands, since there is no "Update" command name. If you want to say that there are no commands for navigating to a folder or opening a file - then you are correct.

Best wishes,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michael
Top achievements
Rank 1
answered on 25 Jun 2009, 07:27 PM

Lini,

Sorry for the typo, I was referring to the "Upload" command...
Thanks for the info.

Tags
FileExplorer
Asked by
Newton
Top achievements
Rank 2
Answers by
Tervel
Telerik team
Shaun Peet
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Lini
Telerik team
Share this question
or