Change InitialPath not working

11 posts, 0 answers
  1. Redmond Rinehart
    Redmond Rinehart avatar
    10 posts
    Member since:
    Feb 2008

    Posted 04 Jun 2009 Link to this post

    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 

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 05 Jun 2009 Link to this post

    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.
  3. Redmond Rinehart
    Redmond Rinehart avatar
    10 posts
    Member since:
    Feb 2008

    Posted 05 Jun 2009 Link to this post

    Hi Georgi, it didn't work for me.  I'll open a support ticket.
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 08 Jun 2009 Link to this post

    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.
  5. Pavel Trnka
    Pavel Trnka avatar
    7 posts
    Member since:
    Aug 2012

    Posted 22 Jun 2009 Link to this post

    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
  6. Pavel Trnka
    Pavel Trnka avatar
    7 posts
    Member since:
    Aug 2012

    Posted 22 Jun 2009 Link to this post

    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

  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 24 Jun 2009 Link to this post

    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.
  8. rami
    rami avatar
    3 posts
    Member since:
    Sep 2012

    Posted 03 Jul 2009 Link to this post

    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
     
  9. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 08 Jul 2009 Link to this post

    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.
  10. Andreas Kaech
    Andreas Kaech avatar
    121 posts
    Member since:
    Sep 2004

    Posted 13 Nov 2009 Link to this post

    Hi Telerik,
    how do I change InitialPath over AjaxRequest?
    Thanks for a hint,
    Andreas
  11. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 16 Nov 2009 Link to this post

    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.
Back to Top