Hi,
Using RadFileExplorer, I want the user to be able to create new subfolders. However, I want to limit this ability to certain existing folders.
Example: The user may create subfolders in folder "Pictures", but not in folder "Agreement".
I can use the server-side OnItemCommand event and cancel the operation if RadFileExplorerEventArgs.Command=="CreateDirectory" and RadFileExplorerEventArgs.Path is not a folder that allows subfolders, but at this point the user has already entered the name of the new folder and pressed OK.
The best solution, I think, would be to disable the Create folder button (and context-menu choice) client-side, depending on which folder is the current folder. Something like this (for the toolbar button):
Using RadFileExplorer, I want the user to be able to create new subfolders. However, I want to limit this ability to certain existing folders.
Example: The user may create subfolders in folder "Pictures", but not in folder "Agreement".
I can use the server-side OnItemCommand event and cancel the operation if RadFileExplorerEventArgs.Command=="CreateDirectory" and RadFileExplorerEventArgs.Path is not a folder that allows subfolders, but at this point the user has already entered the name of the new folder and pressed OK.
The best solution, I think, would be to disable the Create folder button (and context-menu choice) client-side, depending on which folder is the current folder. Something like this (for the toolbar button):
<telerik:RadFileExplorer OnClientFolderChange="OnClientFolderChange" EnableCreateNewFolder="True"....
Javascript:
function
OnClientFolderChange(sender, args) {
if
(args.get_path() !=
"Pictures"
) {
var
tbitem =
sender.get_toolbar().findItemByValue(
"NewFolder"
);
if
(tbitem !=
null
)
{
tbitem.disable();
}
}
}
Unfortunately, this does not work. The toolbar button gets disabled, but then enabled again, immediately after.
In addition, this would be solved very easily if the EnableCreateNewFolder property of RadFileExplorer could be set client-side, using javascript. Is that possible, or do you guys have a different solution?
Thanks,
Arnstein