Information about event

12 posts, 2 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 08 Apr 2009 Link to this post

    Hi,

    since there is absolutely no documentation about RadFileExplorer I have to ask the question here.

    First of all - NO documentation means really NO.
    I'm used from Silverlight that some controls are not describe in the "Controls" section of the help.
    But at least there is help (even tho it is just "automatically generated content" in the class references).
    But here I find nothing at all.

    Anyhow - from the properties I found an event

    OnItemCommand


    But it seems as if this event is never fired.
    My approach is to give the user a browser - after he selects a file I decide if this file should be downloaded, edited with a RadEditor or...

    The Idea was - I handle the OnItemCommand.
    And I guessed there is a "CommandName==Open" or something like this.
    So the idea was:
    ....OnItemCommand(....) {
    if(e.CommandName=="Open")    {
        if(IsFileEditable(e.Path))    {
          string strContent=ReadFile(e.Path);
          RadEditor1.Content=strContent.
          RadFileExplorer1.Visible=false;
          RadEditor1.Visible=true;
          SaveButton.Visible=true;
          CancelButton.Visible=true;
    }
    .....
    BUT - the OnItemCommand handler never get's fired - and due to the missing documentation I have no idea how to solve this.

    And YES I have seen the "FileExplorer" sample.
    BUT: the things get handled on the client - I need them on the server.
    AND: exactly the thing where the FileExplorer comes to play is not visible since this is done in some other APSX file - and this file is not listed in the sample.
    So all I could see there was a pages which calls a dialog and from this it get's (with some kind of magic :)) the filepath.

    Regards

    Manfred
  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 08 Apr 2009 Link to this post

    Hi,

    I tried to build a workaroung - but I got stuck.
    The approach was the same as before - then I got the problems and reduced the things to do as less as possible.
    First the idea - I use RadManager - call a function.
    In this function I switch the UI (hide FileExplorer, show Editor and Save / Cancel buttons).
    Reduced I do nothing more than call the function and simply return.
    The Error occures as soon as I include the FileExplorer in the updated Controls.
    This is a must - since I plan to hide / show the thing.
    Currently I simply set a label to the path and return.
    Here my ASPX
     
        <script type="text/javascript">  
            function OnFileOpen(sender, args) {  
                var item = args.get_item();  
                if (item.get_type() == Telerik.Web.UI.FileExplorerItemType.File) {  
                    args.set_cancel(true);  
                    InitiateAsyncRequest(item.get_path());  
                }  
            }  
            function InitiateAsyncRequest(argument) {  
                var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");  
                ajaxManager.ajaxRequest(argument);  
            }  
     
        </script> 
     
    </asp:Content> 
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="alpPan1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="lblErg" /> 
                        <telerik:AjaxUpdatedControl ControlID="rfxFiles" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="alpPan1" runat="server" Height="75px" Width="75px" Transparency="5">  
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" /> 
        </telerik:RadAjaxLoadingPanel> 
     
        <telerik:RadFileExplorer ID="rfxFiles" runat="server" Configuration-ViewPaths="~/XFiles" OnClientFileOpen="OnFileOpen">  
            <Configuration ViewPaths="~/XFiles" SearchPatterns="*.*"></Configuration> 
        </telerik:RadFileExplorer> 
        <telerik:RadEditor ToolsFile="/Images/ToolsForContent.xml" Skin="Office2007" Language="de-DE" ID="edTheDefault" runat="server" Width="600px" AutoResizeHeight="true" Visible="false">  
            <Content> 
            </Content> 
        </telerik:RadEditor> 
        <asp:Label ID="lblErg" runat="server" /><br /> 
        <asp:Button ID="btnSave" runat="server" Text="Speichern" OnClick="btnSave_Click" Visible="false" />&nbsp;&nbsp;  
        <asp:Button ID="btnCancel" runat="server" Text="Abbrechen" OnClick="btnCancel_Click" Visible="false" /> 
    </asp:Content> 
     

    And my Code behind:
        protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) {  
                lblErg.Text = e.Argument;  
                return;  
                    }  
     

    The label displays the path - but the Filemanager shows the loading symbol and does not stop until I select (about 3 to 5 times) a different directory.

    Regards

    Manfred
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Lini
    Admin
    Lini avatar
    2144 posts

    Posted 10 Apr 2009 Link to this post

    Hi Manfred,

    First I would like to apologize for the missing documentation. The RadFileExplorer control provides one server side event - OnItemCommand, which is called on the following commands:

    • UploadFile - fired before each uploaded file is saved
    • MoveDirectory - fired before a directory is moved/renamed
    • CreateDirectory - fired before the file explorer creates a new folder
    • DeleteDirectory - fired before the file explorer deletes a folder
    • DeleteFile - fired before a file is deleted
    • MoveFile - fired before a file is moved/renamed

    Unfortunately, the fileOpen command is fired only on the client. If you want to do some server-side processing when the user tries to open a file, you need to handle the client open event (OnClientFileOpen) and make an postback or ajax request there with the selected file name.

    I can see that you already have taken the correct approach. Unfortunately, I was not able to reproduce the problem using the code you sent and the current RadControls release (2009.1.402 .NET 2.0). If possible open a formal support ticket and send us a page or a sample project we can use to reproduce it.

    Best wishes,
    Lini
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  5. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 10 Apr 2009 Link to this post

    Hi,

    this is no longer a problem.
    I host the FileExplorer now in a usercontrol - and I got all what I need.
    I'll provide this solution on Code Samples in the next days.

    Thank you for your help

    Manfred
  6. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 10 Apr 2009 Link to this post

    Hello Manfred,

    We are looking forward to receiving your sample :)

    Best regards,
    Tervel
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  7. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 10 Apr 2009 Link to this post

    Hi Tervel,

    it's almost done - take a look at this post :)
    http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/section-in-code-samples.aspx#795668

    Regards

    Manfred
    theonewhohastogotobednow
  8. Answer
    Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 13 Apr 2009 Link to this post

    Hello Manfred,

    You have made an extensive post :) We will use some of the ideas for improving the RadFileExplorer documentation!
    Your telerik points were updated.

    Best regards,
    Tervel
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  9. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 13 Apr 2009 Link to this post

    Thank you Tervel,

    now only my code has to pass screening :)

    Regards

    Manfred
  10. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 14 Apr 2009 Link to this post

    Just a stupid question - could it be that I made something wrong uploading the sample to code library?
    I did it on Saturday - got a message "Success" - but till now I can't neither see the example nor did I get a "you did something wrong" message.
    As I remember there is something written at Code library that it takes "not more than 7x hours...".

    EDIT: I found it:

    >>How long does it take for my project to be approved?

    >>Telerik promises the project to be Live in 72 hours, unless it has not passed the screening process.


    Regards

    Manfred
    theeagerone
  11. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 15 Apr 2009 Link to this post

    Hi Manfred,

    The Code Library article is published and available here. Once again - thank you for your involvement :)



    Sincerely yours,
    Georgi Tunev
    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.
  12. praveen thangaraja
    praveen thangaraja avatar
    3 posts
    Member since:
    Dec 2009

    Posted 02 May 2011 Link to this post

    HI,
          When i tried to view the sample code provided, i am getting server error. so please help me in getting the sample code.

    Thanks
    Praveen.T
  13. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 09 May 2011 Link to this post

    Hi Praveen,

    You can find the above mentioned code library in the following link:
    http://www.telerik.com/community/code-library/aspnet-ajax/file-explorer/extending-the-radfileexplorer.aspx

    Greetings,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017