first file always selected item

3 posts, 1 answers
  1. Ryan Fligg
    Ryan Fligg avatar
    3 posts
    Member since:
    Apr 2010

    Posted 16 Apr 2010 Link to this post

    We're having a problem with the RadFileExplorer.OnClientItemSelected javascript method.  The method always gets the data for the first file item instead of the selected one.  Here is the javascript:

                function OnClientItemSelected(sender, args)
                {
                   if (args.get_item().get_type() == Telerik.Web.UI.FileExplorerItemType.File)
                   {
                       // if the item is a file
                       var file = ""File path : "" + args.get_item().get_path() + ""\n"";
                       file = file + ""File size : "" + args.get_item().get_size();
                       var label = $get(""" + labelClientID + @""");
                       label.innerText = file;
                       alert(""Selected file: \n"" + file);
                   }
                   else
                   {// folder
                       alert(""The selected item is a directory"");
                   }
                   alert(""OnClientItemSelected : "" + (args instanceof Telerik.Web.UI.RadFileExplorerEventArgs).toString());
                }

    So it seems that the args.get_item() is always selecting the first file item.  How do we fix this?  I've also attached a screenshot.  You can see the info in the label is for the first file instead of the selected one.
  2. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 21 Apr 2010 Link to this post

    Hi Ryan,

    I tried to reproduce the problem using the provided code but to no avail. Could you please open a support ticket and attach a sample runnable project that reproduces the problem so we can investigate it further?

    Could you please find the movie demonstrating my test and see if I am doing something wrong?

    Greetings,
    Dobromir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryan Fligg
    Ryan Fligg avatar
    3 posts
    Member since:
    Apr 2010

    Posted 21 Apr 2010 Link to this post

    hi, first, sorry about the extra posts on this, the forum was saying there was an error when I posted this on saturday or whenever.

    I actually already figured out this problem.  I specified the wrong value for the location in my FileItems in my custom FileBrowserContentProvider.  Here's a link to my blog article, RadFileExplorer First File Always Selected Bug Solved, with all the details.

    Thanks for your help!
Back to Top