Catching The Value of the Selected Item(s)

3 posts, 0 answers
  1. AHIS - FLJAC Master License Account
    AHIS - FLJAC Master License Account avatar
    3 posts
    Member since:
    Jun 2010

    Posted 01 Mar 2011 Link to this post

    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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 03 Mar 2011 Link to this post

    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. AHIS - FLJAC Master License Account
    AHIS - FLJAC Master License Account avatar
    3 posts
    Member since:
    Jun 2010

    Posted 04 Mar 2011 Link to this post

    Thank you very much. This was very helpful!
Back to Top