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

Overwrite Files Checkbox

2 Answers 92 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 01 Jun 2009, 08:26 PM
For the FileExplorer control, is it possible to hid the Overwrite Files checkbox in the upload window?

2 Answers, 1 is accepted

Sort by
0
Accepted
Fiko
Telerik team
answered on 02 Jun 2009, 11:39 AM
Hi Chris,

There is no property for that behavior, but you can achieve the desired result by using the following client-side approach:
  • attach a handler to the OnClientLoad event of the RadFileExplorer event
  • get reference to the embedded RadWindowManager object
  • attach a handler to the OnClientshow event of the newly opened RadWindows, by using the client-side API of the RadWindowManager
  • implement a code into the OnClientShow handler in order to hide the checkbox from the upload window
The complete code should looks like the follows :

<script type="text/javascript"
    var oFileExplorer; 
    function OnExplorerLoad(oExplorer, args) 
    { 
        oFileExplorer = oExplorer; 
        var oWinManager = oExplorer.get_windowManager(); // get the window manager 
        oWinManager.add_show(openRadWindow); // Attach event handler to the newly opened windows 
    } 
 
    function openRadWindow(oWindow, args) 
    { 
        if (oWindow.get_id() == "fileExplorerUpload"
        { 
            var chkBoxID = oFileExplorer.get_id() + "_chkOverwrite"// Build the ID of the checkbox 
 
            var checkBox = document.getElementById(chkBoxID); 
            checkBox.style.display = "none";// Hide the check box 
            checkBox.nextSibling.style.display = "none"// Hide the text next to the checkbox ; 
        } 
    } 
</script> 

I suggest that client approach, because the RadFileExplorer1.Upload.ControlObjectsVisibility server property does not accept the passed values. We assign value to this property in a later stage of the RadFileExplorer's life cycle and this cause that behavior.

I hope this helps.

All the best,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bob van der Zinch
Top achievements
Rank 2
answered on 24 May 2010, 08:33 PM
if (oWindow.get_id() == "fileExplorerUpload")  
this condition should be fixed this way I guess

if (oWindow.get_id() == oFileExplorer.get_windowManager().get_id() + "fileExplorerUpload")  
Tags
FileExplorer
Asked by
Chris
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Bob van der Zinch
Top achievements
Rank 2
Share this question
or