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

Is there a way to set selected files onclientload?

1 Answer 78 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 19 Sep 2013, 10:00 AM
Hi

I'm using RadFileExplorer to select multiple images, is there a way to preselect files either clientside or serverside?

/Thomas

Btw. thanks for these excellent tools :)

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 20 Sep 2013, 02:39 PM
Hi Thomas,

I already answered you support ticket on the subject. For convenience I will post my answer here as well.

If you want to preselect a single item in RadFileExplorer, you can user its server side property InitialPath to achieve this. Please see the following live demo for more information:
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/initialpathandpaging/defaultcs.aspx

If you want to select multiple items and do have FileList enabled (ExplorerMode is not set to FileTree) you can use the following JavaScript approach:
$find("<%=RadFileExplorer1.ClientID %>").get_fileList().selectFileList(["Flower3.jpg","Flower5.jpg","Flower4.jpg"])

The selectFileList method of the RadFileExplorer's FileList client-object accepts an array of string providing the names of the files to be selected. Please note that first you need to navigate to the folder containing these files, you can do that either using InitialPath property or calling loadFolder(path) client-side method of RadFileExplorer.

More detailed information regarding RadFileExplorer's client-side and server-side members is available in our online documentation.


Regards,
Dobromir
Telerik
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 the blog feed now.
Tags
FileExplorer
Asked by
Thomas
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or