The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientFileManager.ItemDeleting Event

Fires on the client side before an item is deleted and allows you to cancel the action.

Declaration

ItemDeleting: ASPxClientEvent<ASPxClientFileManagerItemEditingEventHandler<ASPxClientFileManager>>

Event Data

The ItemDeleting event handler receives an argument of the ASPxClientFileManagerItemEditingEventArgs type. The following properties provide information specific to this event.

Property Description
cancel Gets or sets a value indicating whether the action which raised the event should be canceled.
fullName Gets the full name of the item currently being processed.
isFolder Gets a value specifying whether the current processed item is a folder.
name Gets the name of the currently processed item.

Remarks

Each time an item is going to be deleted, the ItemDeleting event occurs, allowing you to cancel the action. You can use the event parameter's properties to identify a name (ASPxClientFileManagerActionEventArgsBase.name) or a full name (ASPxClientFileManagerActionEventArgsBase.fullName) of the deleted item. The ASPxClientFileManagerActionEventArgsBase.isFolder property indicates the type of a currently being deleted item: file or folder.

To cancel the delete operation, set the ASPxClientFileManagerItemEditingEventArgs.cancel property to true.

After an item has been deleted, the ASPxClientFileManager.ItemDeleted event is raised.

Examples

The code below demonstrates how you can prohibit end-users from deleting any folder.

<dx:ASPxFileManager ID="ASPxFileManager1" runat="server">
      <Settings ThumbnailFolder="~\Thumb" RootFolder="~\" />
      <SettingsEditing AllowDelete="True" />
      <ClientSideEvents ItemDeleting="function(s, e) {
            if (e.isFolder) {
            e.cancel = true;
            }
      }" />
</dx:ASPxFileManager>
See Also