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

Invoke FileExplorer commands from custom button

1 Answer 67 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 26 Nov 2010, 02:31 PM
Hi,

I'm building my own custom "toolbar" (it's not a RadToolBar) on a page containing a FileExplorer, amongst other things. From that custom toolbar, I'd like to invoke some of the built in commands in FileExplorer.

So, as an example, when clicking my own custom "New Folder" button, it does the exact same thing as the New Folder toolbar button does in FileExplorer: Opens up the FileExplorers _own_ 'New Folder' dialog.

I would like to be able to do this for 'New Folder', 'Delete', 'Upload', and the rest of the built in commands in FileExplorer.

It it doable?

Thank you,
Best regards,
Andreas



1 Answer, 1 is accepted

Sort by
0
Accepted
Fiko
Telerik team
answered on 01 Dec 2010, 10:49 AM
Hello Andreas,

You can use these commands in order to implement your scenario:
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function openUpload()
        {
            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
            var uploadItem = oExplorer.get_gridContextMenu().findItemByValue("Upload"); // use the contextmenu's Upload command
            uploadItem.click();
        }
 
        function callDelete()
        {
            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
            var uploadItem = oExplorer.deleteSelectedItems(); // http://www.telerik.com/help/aspnet-ajax/radfileexplorer-client-side.html
            uploadItem.click();
        }
 
        function openCreateNewDirectory()
        {
            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
            oExplorer.createNewDirectory(); // http://www.telerik.com/help/aspnet-ajax/radfileexplorer-client-side.html
        }
    </script>
</telerik:RadScriptBlock>


Regards,
Fiko
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
FileExplorer
Asked by
Andreas
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or