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

Disable Double Clicks on Items

2 Answers 63 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 16 Nov 2011, 07:00 PM
Is a setting available for the RadFileExplorer which will allow for only single clicks on items, rather than allowing a double click on a given item?

The EnableOpenFile-"False" property is set on the RadFileExplorer, but this does not disallow double clicking;

Any insight is appreciated;  Best regards - Rob

2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 17 Nov 2011, 02:53 PM
Hello,

Method 1 :
<telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="520px"
          OnClientFileOpen="ClientFileOpen">
          <Configuration ViewPaths="~/Pictures/" />
      </telerik:RadFileExplorer>
<script type="text/javascript">
     function ClientFileOpen(sender, eve) {
         eve._cancel = true;
     }
 </script>


Method 2:

<telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="520px"
            EnableOpenFile="false">
            <Configuration ViewPaths="~/Pictures/" />
        </telerik:RadFileExplorer>


Thanks,
Jayesh Goyani
0
Accepted
Dobromir
Telerik team
answered on 21 Nov 2011, 09:58 AM
Hi Rob,

The EnableFileOpen property of RadFileExplorer is controlling if the preview window (or the download dialog) should appear when a file is opened.

The Method 1 of the Jayesh's post is the way to disable the doubleclick in the Grid component of RadFileExplorer.

I just wanted to point out that in the posted handler a private property is used, which is not recommended. You should use its setter instead set_cancel(). Also, this will disable the doubleclick on a folder and will prevent navigation. You can check if the clicked item is file or folder using the isDirectory() method, e.g.:
<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" EnableOpenFile="false" OnClientFileOpen="OnClientFileOpen">
    <Configuration ViewPaths="~/ROOT" />
</telerik:RadFileExplorer>
 
<script type="text/javascript">
    function OnClientFileOpen(explorer, args)
    {
        if (!args.get_item().isDirectory())//check if the clicked item is a folder
            args.set_cancel();
    }
</script>


Best wishes,
Dobromir
the Telerik team
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 their blog feed now
Tags
FileExplorer
Asked by
Robert
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Dobromir
Telerik team
Share this question
or