Back to Devexpress

FileManagerSettings.EnableMultiSelect Property

aspnet-devexpress-dot-web-dot-filemanagersettings-56fb10cb.md

latest4.3 KB
Original Source

FileManagerSettings.EnableMultiSelect Property

Specifies whether to enable multiple file selection in the file manager.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
Booleanfalse

true, to enable multiple file selection; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to EnableMultiSelect
ASPxFileManager

.Settings .EnableMultiSelect

|

Remarks

Set the EnableMultiSelect property to true to enable multiple file selection in the file manager. The ASPxFileManager.SelectedFiles collection contains selected files. Use the ASPxClientFileManager.GetSelectedItems method to access selected files on the client side.

Keyboard Support

Use the following keys and key combinations to select multiple files in the file manager:

  • Use the ARROW keys to move focus.
  • Use the SPACE key to mark a focused file as either selected or unselected.
  • Hold the CTRL key and focus a file to add to or delete the file from the currently selected files.
  • Hold down the SHIFT key and use the ARROW keys or the mouse to select multiple files in the file manager.

Example

Web Forms:

aspx
<dx:ASPxListBox ID="ASPxListBox1" ClientInstanceName="filesList" runat="server" Height="250px" Width="100%" />

Selected count: <strong id="filesCount">0</strong>

<dx:ASPxFileManager ID="ASPxFileManager1" ClientInstanceName="fileManager" runat="server">
     <Settings EnableMultiSelect="true" RootFolder="~/Content/FileManager/Files/Images" InitialFolder="Product icons" ThumbnailFolder="~/Content/FileManager/Thumbnails"/>
     <ClientSideEvents SelectionChanged="fileManager_SelectionChanged" />
</dx:ASPxFileManager>
js
function fileManager_SelectionChanged(s, e) {
     filesList.ClearItems();
     var selectedFiles = s.GetSelectedItems();
     for(var i = 0; i < selectedFiles.length; i++) {
          filesList.AddItem(selectedFiles[i].name);
     }
     document.getElementById("filesCount").innerHTML = selectedFiles.length;
}

MVC:

csharp
@Html.DevExpress().FileManager(settings =>
{
    settings.Name = "fileManager";
    settings.Settings.InitialFolder = "Product icons";
    settings.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
    settings.Settings.EnableMultiSelect = true;
    ... 
}).BindToFolder(Model).GetHtml()
js
function fileManager_SelectionChanged(s, e) {
     filesList.ClearItems();
     var selectedFiles = s.GetSelectedItems();
     for(var i = 0; i < selectedFiles.length; i++) {
          filesList.AddItem(selectedFiles[i].name);
     }
     document.getElementById("filesCount").innerHTML = selectedFiles.length;
}

Online Demos

See Also

ASPxFileManager

File Manager

FileManagerSettings Class

FileManagerSettings Members

DevExpress.Web Namespace