For the FileExplorer control, is it possible to hid the Overwrite Files checkbox in the upload window?
2 Answers, 1 is accepted
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.