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

Catching The Value of the Selected Item(s)

2 Answers 51 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
AHIS - FLJAC Master License Account
Top achievements
Rank 1
AHIS - FLJAC Master License Account asked on 01 Mar 2011, 05:16 PM
I am using a C# code behind page, and have written some custom buttons with OnClick events on that code behind page. I simply need to determine which items are selected in the FileExplorer so that I can pass the value of the File Name(s) to a Microsoft SQL Database. Can you tell me how to find the file names of the selected files? Thank you.

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Mar 2011, 09:47 AM

Hello!

This can be achieved with a small JavaScript function. The basic steps are:

  • get a reference to the FileExplorer ($find("<%= RadFileExplorer1.ClientID %>") for example)
  • get the selected items with the get_selectedItems() method
  • iterate through the array and get each item's path via its get_path() method
  • et the file name with the lastIndexOf() and substring() methods
  • apply your logic (directly send it to the database, send it to the server first, etc)
  • attach the function to a comfortable event (an onclick for a button or any other depending on your scenario).

More information on the subject is available in this Knowledge base article. Another related scenario is covered in this article.

The reason I am first offering you a JavaScript solution is that with respect to performance most of the functionality of the FileExplorer is on the client-side. Alternatively you can modify the example project in the first Knowledge Base article to fit your needs.



Best wishes,
Marin
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
AHIS - FLJAC Master License Account
Top achievements
Rank 1
answered on 04 Mar 2011, 04:11 PM
Thank you very much. This was very helpful!
Tags
FileExplorer
Asked by
AHIS - FLJAC Master License Account
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
AHIS - FLJAC Master License Account
Top achievements
Rank 1
Share this question
or