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

selected image by default when opening the image manager

2 Answers 23 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Balu
Top achievements
Rank 1
Balu asked on 02 Oct 2012, 11:49 AM
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 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 04 Oct 2012, 03:59 PM
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,
Vesi
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.
0
Gilles
Top achievements
Rank 1
answered on 21 Mar 2017, 02:47 PM

Hi,

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)

Tags
ImageEditor
Asked by
Balu
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Gilles
Top achievements
Rank 1
Share this question
or