selected image by default when opening the image manager

3 posts, 0 answers
  1. Balu
    Balu avatar
    3 posts
    Member since:
    Apr 2009

    Posted 02 Oct 2012 Link to this post

    I am using the ImageManager separately using DialogOpener. I have a scenario that, I need to show the selected image by default when opening the image manager. Is there any way to do this?
  2. Vessy
    Vessy avatar
    2070 posts

    Posted 04 Oct 2012 Link to this post

    Hi Balaji,

    If you want the preselected image to be always one and the same, you will need to customize the RadEditor's FileExplorer dialog by setting the path to the desired image as a value of the InitialPaths FileExplorer's property. Please, keep in mind that the value set to InitialPaths is case sensitive and should be in the same format as shown in the FileExplorer's address bar (without "~" in front of it).

    If you want to change this path multiple times, you will need to do it Client Side. There is KB article showing how to set the value of this property by passing the text to a text-box (which could be hidden), available on the following link: Using the Image and Document managers outside RadEditor.

    For your convenience we modified the example from the above mentioned article, so it is showing a preselected image or file now, so you can extend it further to match the needs of your custom scenario.

    Kind regards,
    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.
  3. Gilles
    Gilles avatar
    4 posts
    Member since:
    Jun 2010

    Posted 21 Mar 2017 Link to this post


    I'm using the example provided by Vessy.
    One textbox (contain the path to the file), one button to open ImageManager via Dialog.
    When opening the imagemanager while the path is empty, everything is fine : imagemanager open the root folder.
    When the path is filled (/dir1/dir2/imgName.jpg), imagemanager open and select the correct image but throws a javascript error 
    Uncaught TypeError: Cannot read property 'length' of null
    at Telerik.Web.UI.Widgets.ImagePreviewer._setupPreviewedImage
    at Telerik.Web.UI.Widgets.ImagePreviewer._imageLoadHandler 
    And then impossible to select a new image.
    This error doesn't appear with the document manager so it must be something with the imagemanager. I also noticed that the image is selected but the informations about the image (width, height, ...) remain empty.
    (sorry my english isn't very good)

Back to Top