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

RadFileExplorer select file server-event

4 Answers 329 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
d-cpt
Top achievements
Rank 2
d-cpt asked on 21 Feb 2011, 03:39 PM
I know RadFileExplorer has client-side script for select file.
Does it has server-side event for select file?

Thanks,
d-cpt

4 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 24 Feb 2011, 11:15 PM
Hi d-cpt,

At present, RadFileExplorer does not offer a server-side event FileSelect. However, you can simulate raising server-side event, by invoking a postback in the OnClientItemSelected client-side event, e.g.:
<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientItemSelected="OnClientItemSelected">
    <Configuration ViewPaths="~/ROOT" />
</telerik:RadFileExplorer>
 
<script type="text/javascript">
    function OnClientItemSelected(sender, args)
    {
        //ItemSelected event is fired on click on item - this include the double click on a folder
        //invoke the postback only if the selected item is file
        if (args.get_item().get_type() == Telerik.Web.UI.FileExplorerItemType.File)
        {
            __doPostBack();
        }
 
    }
</script>

Please note that ItemSelected client-side event is fired when user tries to open a folder by double-click on the grid.

Kind regards,
Dobromir
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
d-cpt
Top achievements
Rank 2
answered on 25 Feb 2011, 01:41 PM
Dear Dobromir,

Thank you so much for your help.

d-cpt

0
Sebastien
Top achievements
Rank 1
answered on 09 Feb 2014, 10:24 AM
Hello

This is exactly what I have done (I also need to call a server side function when selecting a file) and it is working. But I have noticed that by doing so, I cannot see the context menu when right-clicking on a file in the grid: in fact the OnClientItemSelected is fired when doing a left click or a right click on a file in the grid. Is there a way to detect (in the method called on the OnClientItemSelected event) if the file has been left or right clicked ? (I have tried to inspect the args and the sender objects filled when the event is raised but I have not seen anything)

Thanks a lot for your help

Sebastien
0
Vessy
Telerik team
answered on 12 Feb 2014, 06:06 PM
Hi Sebastien,

This behavior is expected and, unfortunately, there is no way to determine which is the mouse button, triggering the ItemSelected event. Does your server functionality update the FileExplorer? In case it does not, I could suggest you to use button placed inside an external update panel (not wrapped around the FileExplorer) and implement the desired logic by updating it (for example using a hidden button).

Regards,
Veselina Raykova
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
FileExplorer
Asked by
d-cpt
Top achievements
Rank 2
Answers by
Dobromir
Telerik team
d-cpt
Top achievements
Rank 2
Sebastien
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or