New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientDelete
The client-side Delete event is raised when a file or folder is deleted in RadFileExplorer.
To handle this event, simply write a JavaScript function that can be called when the event occurs. Then assign the name of this function as the value of the OnClientDelete property of the control.
The client-side OnClientDelete event handler receives two arguments:
-
Sender: The RadFileExplorer object that fired the event.
-
Event arguments: An event arguments object of type Telerik.Web.UI.FileExplorerEventArgs that exposes the following methods:
Table 1: OnClientDelete Event Arguments Object
Name Parameters Return Type Description get_cancel() Boolean Returns a value that indicates whether the event is cancelled. get_item() Object Returns the file/folder that will be deleted. get_path() String Returns the path to the deleted file/folder. set_cancel(value) Boolean Sets whether the event will be cancelled (if true is passed).
Example 1: Handle the RadFileExplorer's client-side Delete event.
ASP.NET
<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientDelete="onClientDelete">
<Configuration ViewPaths="~/Images" DeletePaths="~/Images" UploadPaths="~/Images" />
</telerik:RadFileExplorer>
<script>
function onClientDelete(fileExplorer, args) {
alert("Deleted file : " + args.get_path());
}
</script>