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

Change InitialPath not working

10 Answers 320 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Redmond Rinehart
Top achievements
Rank 1
Redmond Rinehart asked on 04 Jun 2009, 07:14 PM
I have a RadGrid where I want a user to select a row and on that postback, I want to set the InitialPath of the FileExplorer based on their selection.  For some reason it isn't working.  When I debug, the path is correct and and there are no errors, but the FileExplorer remains empty.  How can I set the InitialPath programmatically?

    Protected Sub rdgSurveys_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles rdgSurveys.SelectedIndexChanged 
        SetFileExplorerPaths() 
    End Sub 
 
    Protected Sub SetFileExplorerPaths() 
        If rdgSurveys.SelectedValue > 0 Then 
            rfeDocuments.Enabled = True 
 
            Dim surveyPath = "~/bin/Documents/Survey_" + rdgSurveys.SelectedValue.ToString 
            Dim paths As String() = {surveyPath} 
            rfeDocuments.InitialPath = surveyPath 
            rfeDocuments.Configuration.UploadPaths = paths 
            rfeDocuments.Configuration.ViewPaths = paths 
            rfeDocuments.DataBind() 
        Else 
            rfeDocuments.Enabled = False 
        End If 
    End Sub 

10 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Jun 2009, 09:09 AM
Hello Redmond,


To set the initial path properly, you need to convert the root relative Url.
e.g.
Dim surveyPath = Page.ResolveUrl("~/bin/Documents/Survey_") + rdgSurveys.SelectedValue.ToString 

I hope this helps. If you still experience problems after that, it will be best to open a support ticket and to send us a sample project where this issue could be reproduced - we will check it right away.


Regards,
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.
0
Redmond Rinehart
Top achievements
Rank 1
answered on 05 Jun 2009, 05:32 PM
Hi Georgi, it didn't work for me.  I'll open a support ticket.
0
Fiko
Telerik team
answered on 08 Jun 2009, 04:04 PM
Hello Redmond,

We already answered your support ticket, but I believe that the attached demo will be of help for our customers that read this thread.
 

Sincerely yours,
Fiko
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
Pavel Trnka
Top achievements
Rank 1
answered on 22 Jun 2009, 04:29 PM
Hi,

can you explain me how I can set initial path if I'm using SPContentProvider class? Is there a different approach?

radFileExplorer.Configuration.ViewPaths = new string[] { "/MyRootFolder" };
radFileExplorer.InitialPath = "/MyRootFolder/1. vrstva Řídící dokumenty/Kolektivní smlouva/";

I know that the path is case sensitive so I have checked twice the source path.

Thx your very much

Pavel
0
Pavel Trnka
Top achievements
Rank 1
answered on 22 Jun 2009, 07:38 PM
Hi,

another frustrating problem.....

I'm using RadFileExplorer control in UserControl and I need to set ViewPaths and other properties after an user clicks on my button.

Following error will occur after click:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Value cannot be null.
Parameter name: virtualPath
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: virtualPath

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: virtualPath]
   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8851319
   System.Web.VirtualPathUtility.GetFileName(String virtualPath) +12
   Telerik.Web.UI.Widgets.FileSystemContentProvider.ResolveRootDirectoryAsTree(String path) +128
   Telerik.Web.UI.RadFileExplorer.GetFileGridData(String path, String sortExpression, Int32 startIndex, Int32 maxRowNumber, Int32& itemsCount) +266
   Telerik.Web.UI.RadFileExplorer.DescribeComponent(ScriptComponentDescriptor descriptor) +1967
   Telerik.Web.UI.RadWebControl.Telerik.Web.IControl.DescribeComponent(ScriptComponentDescriptor descriptor) +39
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) +182
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(WebControl control) +31
   Telerik.Web.UI.RadWebControl.GetScriptDescriptors() +30
   Telerik.Web.UI.RadWebControl.System.Web.UI.IScriptControl.GetScriptDescriptors() +33
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +491
   System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl scriptControl) +50
   Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors() +66
   Telerik.Web.UI.RadWebControl.Render(HtmlTextWriter writer) +149
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10

Thanks again for your help.

Pavel

0
Lini
Telerik team
answered on 24 Jun 2009, 07:34 AM
Hello Pavel,

The "Value cannot be null." has been fixed and the fix will be included in the Q2 2009 official release.

The value of the InitialPath property must be equal to what you see in the address bar of the file explorer control when you have navigated to the folder you want to be opened initially.


Regards,
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
rami
Top achievements
Rank 1
answered on 03 Jul 2009, 01:27 PM
The "Value cannot be null." has been fixed and the fix will be included in the Q2 2009 official release!! i don't think so as i create virtual dirictory in my project map to share folder and i still have the same error. Please help
 
0
Lini
Telerik team
answered on 08 Jul 2009, 10:27 AM
Hello rami,

If you have not done so already, please open a formal support ticket and send us some more information about your project, a test page, or a complete sample project, so we can see the error here and provide you with a solution. Thanks in advance for your cooperation!

Sincerely yours,
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
Andreas Kaech
Top achievements
Rank 1
answered on 13 Nov 2009, 08:15 PM
Hi Telerik,
how do I change InitialPath over AjaxRequest?
Thanks for a hint,
Andreas
0
Lini
Telerik team
answered on 16 Nov 2009, 08:23 AM
Hello Andreas,

InitialPath is only taken into account when the file explorer is first loaded and populated with data. If you want to change the folder after that, you can use the explorer.loadFolder(path) client API method. This will make an Ajax request and change the current folder in the file explorer's tree and grid components.

Sincerely yours,
Lini
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.
Tags
FileExplorer
Asked by
Redmond Rinehart
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Redmond Rinehart
Top achievements
Rank 1
Fiko
Telerik team
Pavel Trnka
Top achievements
Rank 1
Lini
Telerik team
rami
Top achievements
Rank 1
Andreas Kaech
Top achievements
Rank 1
Share this question
or