Skip to main content
A newer version of this page is available. .
Tab

FileManagerActionEventArgsBase.Cancel Property

Gets or sets a value indicating whether the action that raised the event should be canceled.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

public bool Cancel { get; set; }

Property Value

Type Description
Boolean

true if the action that raised the event should be canceled; otherwise, false.

Remarks

The FileManagerActionEventArgsBase object is passed to the events that fire before specific actions. The Cancel property of this object enables you to cancel the action that is about to be performed. Set this property to true to cancel the action that raised the event. In this case, if the FileManagerActionEventArgsBase.ErrorText property is specified, the explanatory message is shown.

Example

The code below demonstrates how you can handle the FolderCreating event, to prevent creation of child folders for the root folder.

The image below shows the result.

ASPxFileManager - FolderCreating

protected void ASPxFileManager1_FolderCreating(object source, DevExpress.Web.FileManagerFolderCreateEventArgs e) {
      if (e.ParentFolder.FullName == "Files")
            e.Cancel = true;
            e.ErrorText = "You cannot create child folders for the root folder";
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Cancel property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also