Make Image Manager pre-open sub-folder

7 posts, 0 answers
  1. Jon
    Jon avatar
    11 posts
    Member since:
    Mar 2011

    Posted 30 Jun 2011 Link to this post

    If I have for example:
    RadEditor1.ImageManager.ViewPaths = new string[] { "~/images" };
    RadEditor1.ImageManager.UploadPaths = new string[] { "~/images/2011/06" };
    RadEditor1.ImageManager.DeletePaths = new string[] { "~/images/2011/06" };
    How do I make the image manager automatically default to the "~/images/2011/06" subfolder when it is opened? It seems to default to displaying the root ViewPaths folder every time, so the user has to each time drill down to the subfolder for every image to be uploaded or inserted.
    There are many subfolders and I would like that when the image manager opens, it pre-selects the folder which the user can upload into.
    Is that possible?
    My scenario is that the users have read-only access to all images, but can only upload/delete in the current month, so it would be good to pre-select that month.
  2. Jon
    Jon avatar
    11 posts
    Member since:
    Mar 2011

    Posted 01 Jul 2011 Link to this post

    Just to add to my question. What I would like is a solution like the InitialPath property of RadFileExplorer.

    Is there a way to have equivalent functionality in the RadEditor ImageManager? Perhaps a way to go to an initial folder with javascript?
    A way to set the InitialPath in the code behind of the page hosting the RadEditor would be best.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 05 Jul 2011 Link to this post

    Hello Jon,

    You can try the solution provided in the following KB article: Select an image or a folder when ImageManager is first shown.

    Greetings,
    Rumen
    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.

  5. Jon
    Jon avatar
    11 posts
    Member since:
    Mar 2011

    Posted 07 Jul 2011 Link to this post

    Hello Rumen,

    I had seen a similar, but not identical, solution elsewhere but was hoping to avoid the proliferation of files in this solution.
    This solution also does not allow a different InitialPath for the ImageManager and DocumentManager.
    I have got around this limitation by putting these values into session state and reading them in the customised editor dialog user controls, which is not ideal but seems to work.

    Jon
  6. neowebgr
    neowebgr avatar
    5 posts
    Member since:
    Nov 2005

    Posted 05 Dec 2012 Link to this post

    Hello Rumen,

    I am trying to do the same thing that Jon describes and I tried the sample code from this article.

    Unfortunately, I couldn't make it run successfully. Instead of opening into a sub folder "~/Root/SekectedImage" it always opens to the root folder "~/Roots/".

    I tried this in an empty Web Forms Application (.NET 3.5 SP1) with the 2012.2.912.35 version.

    Here is my default.aspx file
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div>
            <telerik:RadEditor ID="RadEditor1" runat="server">
            </telerik:RadEditor>
        </div>
        </form>
    </body>

    and here is my default.aspx.vb file
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RadEditor1.ImageManager.ViewPaths = {"~/UsersFiles"}
         If (Not Page.IsPostBack()) Then
             Dim initialPath As String = RadEditor1.DialogHandlerUrl + "?initialPath=" + HttpContext.Current.Request.ApplicationPath + "/UsersFiles/admin/images/"
            RadEditor1.DialogHandlerUrl = initialPath
        End If
    End Sub

    Do you have any idea why this isn't working?

    Thank you
  7. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 07 Dec 2012 Link to this post

    Hi,

    You should replace the ?initialPath with ?PreselectedItemUrl

    This change should help you.

    Regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. neowebgr
    neowebgr avatar
    5 posts
    Member since:
    Nov 2005

    Posted 12 Dec 2012 Link to this post

    Indeed, with this change it worked!

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