Back to Devexpress

FileManagerSettingsEditing.AllowRename Property

aspnet-devexpress-dot-web-dot-filemanagersettingsediting-92e7901f.md

latest6.1 KB
Original Source

FileManagerSettingsEditing.AllowRename Property

Gets or sets a value specifying whether items can be renamed.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public virtual bool AllowRename { get; set; }
vb
<DefaultValue(False)>
Public Overridable Property AllowRename As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true, if item renaming is allowed; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to AllowRename
ASP.NET MVC ExtensionsFileManagerSettings

.SettingsEditing .AllowRename

| | ASP.NET Web Forms Controls | ASPxFileManager |

.SettingsEditing .AllowRename

|

Remarks

Use the AllowRename property to control whether items can be renamed.

An end-user can rename a file manager item using the toolbar rename button or context menu Rename item, whose availability depends on the AllowRename property value.

Toolbar Rename Button

The rename button is displayed in the toolbox if the FileManagerSettingsToolbar.Items collection contains an object of the FileManagerToolbarRenameButton type. In this case, the AllowRename property specifies the button’s availability.

When the FileManagerSettingsToolbar.Items collection is empty, the AllowRename property specifies the rename button visibility.

Context Menu Rename Item

The rename item is displayed in the context menu if the FileManagerSettingsContextMenu.Items collection contains an object of the FileManagerToolbarRenameButton type, or if the FileManagerSettingsContextMenu.Items collection is empty. The AllowRename property specifies the item availability.

Example

Web Forms (in markup):

aspx
<dx:ASPxFileManager ID="fileManager" runat="server" >
    <SettingsEditing AllowCreate="true" AllowDelete="true" AllowMove="true" AllowRename="true" 
    AllowCopy="true" AllowDownload="true" />    
    ...
</dx:ASPxFileManager>

Web Forms (in code):

csharp
ASPxFileManager fm = new ASPxFileManager();
...
fm.SettingsEditing.AllowCreate = true;
fm.SettingsEditing.AllowDelete = true;
fm.SettingsEditing.AllowMove = true;
fm.SettingsEditing.AllowRename = true;
fm.SettingsEditing.AllowCopy = true;
fm.SettingsEditing.AllowDownload = true;

MVC:

csharp
@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";
    settings.SettingsEditing.AllowCreate = true;
    settings.SettingsEditing.AllowDelete = true;
    settings.SettingsEditing.AllowMove = true;
    settings.SettingsEditing.AllowRename = true;
    settings.SettingsEditing.AllowCopy = true;
    settings.SettingsEditing.AllowDownload = true;
    ...
}).BindToFolder(Model).GetHtml()

Online Demo

Example

The image below demonstrates the example’s file structure in the web site solution explorer and in the file manager.

The code sample below demonstrates an example of the ASPxFileManager control’s markup.

aspx
<dx:ASPxFileManager ID="ASPxFileManager1" runat="server" Width="700px">
     <Settings RootFolder="~\Files\" ThumbnailFolder="~\Thumbnails\" 
          AllowedFileExtensions=".jpg, .jpeg, .gif, .rtf, .txt, .avi, .png, .mp3, .xml, .doc, .pdf" InitialFolder="Images\Employees" />
     <SettingsEditing AllowCreate="True" AllowDelete="True" AllowMove="True" AllowRename="True" />
     <SettingsPermissions>
          <AccessRules>
               <dx:FileManagerFolderAccessRule Edit="Deny" />
               <dx:FileManagerFolderAccessRule Edit="Allow" Path="Documents\Reports" />
          </AccessRules>
     </SettingsPermissions>
</dx:ASPxFileManager>

See Also

Items

Rename Button

File Manager Toolbar

Context Menu

FileManagerToolbarRenameButton

File Manager

FileManagerSettingsEditing Class

FileManagerSettingsEditing Members

DevExpress.Web Namespace