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

server-side programming not working

5 Answers 116 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Roland Koops
Top achievements
Rank 1
Roland Koops asked on 09 Apr 2010, 08:03 AM

 

If I specify viewpaths, uploadpaths, deletepaths, and SearchPatterns properties in the ASPX file, then the control works, i.e., the SearchPatterns are applied and I can upload files.

If I specify viewpaths, uploadpaths, deletepaths, and SearchPatterns properties in my code behind, then I have the following problems:

 

  1. upload is not enabled;
  2. delete button is not enabled; and
  3. SearchPatterns are not applied.

I use version 2010.1.309.35.

ASPX:

    <telerik:RadFileExplorer runat="server" ID="explorer" EnableViewState="true" Width="700px" Height="480px"  > 
    <Configuration ViewPaths="~/Content/1/" UploadPaths="~/Content/1/" DeletePaths="~/Content/1/" MaxUploadFileSize="8000000" SearchPatterns="*.png" /> 
    </telerik:RadFileExplorer> 
 

 

 


C#:
string[] paths = new string[] { "~/Content/2/""~/Content/1/"};  
 
explorer.Configuration.MaxUploadFileSize = 1024 * 1024 * 8; // 8Mb  
explorer.Configuration.SearchPatterns = new string[] { "*.png""*.jpg""*.gif" };  
explorer.Configuration.ViewPaths = paths;  
explorer.Configuration.UploadPaths = paths;  
explorer.Configuration.DeletePaths = paths; 

5 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 09 Apr 2010, 05:14 PM
Hi Roland,

We are not aware of such a problem. I tried to reproduce it on our side using the provided code snippets but to no avail. Could you please, open a support ticket and provide a sample runnable project that reproduces the problem so we can investigate it further?

For your convenience I have attached my sample text project and a movie demonstrating my test. You can also modify the project to the point where the problem occurs and send it back.

Regards,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen Finchett
Top achievements
Rank 1
answered on 13 Apr 2010, 11:15 PM
I have exactly the same problem.

I have followed your example and that works fine.  So does setting the configuration items in the aspx page itself. 

I have the control hidden to start with.  After clicking a button, I make it visible and set the config.  These changes do not update the files in the control.  I added another button to the page and when it is clicked after making the control visible and setting the config, the file explorer updates perfectly.

After reading a few more posts it appears that the config MUST be set in the load event handler.  If not, the control is not updated properly.  I cannot do this; it must be done in an event handler that is called AFTER the load event.  Is there something I am missing or is this a fairly important limitation?


Ste
0
Roland Koops
Top achievements
Rank 1
answered on 14 Apr 2010, 07:54 AM

Unfortunately I cannot attach zip files, but I have modified your default.apsx.cs. With some addition to the code the control does not work.

public partial class Default : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        string[] paths = new string[] { "~/Content/1/""~/Content/2/" };  
 
        /* If this settings are set before the configuration settings the control does not work anymore */ 
        RadFileExplorer1.ExplorerMode = FileExplorerMode.FileTree;  
        RadFileExplorer1.VisibleControls = FileExplorerControls.ContextMenus | FileExplorerControls.Toolbar | FileExplorerControls.TreeView;  
        RadFileExplorer1.Language = Thread.CurrentThread.CurrentUICulture.Name;  
        RadFileExplorer1.EnableCreateNewFolder = true;  
        RadFileExplorer1.EnableOpenFile = true;  
 
        RadFileExplorer1.Configuration.MaxUploadFileSize = 1024 * 1024 * 8; // 8Mb    
        RadFileExplorer1.Configuration.SearchPatterns = new string[] { "*.png""*.jpg""*.gif" };  
        RadFileExplorer1.Configuration.ViewPaths = paths;  
        RadFileExplorer1.Configuration.UploadPaths = paths;  
        RadFileExplorer1.Configuration.DeletePaths = paths;  
    }  
}  
 
 
0
Dobromir
Telerik team
answered on 16 Apr 2010, 01:16 PM
Hi Roland,

Thank you for the clarification. I was able to reproduce the problem and can confirm that this is a bug. I logged it into our PITS system and we will do our best to fix it for one of our upcoming releases. You can follow the PITS Issue by its ID: 1815

For the time being, as a workaround you can set UploadPaths and DeletePaths before setting EnableCreateNewFolder.

As a small token of gratitude I have updated your Telerik points.

Best wishes,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Neil
Top achievements
Rank 1
answered on 06 Jan 2011, 11:25 PM
Was a solution ever created for this problem?  I'm trying to do the exact same thing within a dynamically loaded UserControl and getting the same results.

Never Mind, the problem wasn't with the control.  It was path related.
Tags
FileExplorer
Asked by
Roland Koops
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Stephen Finchett
Top achievements
Rank 1
Roland Koops
Top achievements
Rank 1
Neil
Top achievements
Rank 1
Share this question
or