Back to Devexpress

ASPxClientFileManager.GetSelectedItems Method

aspnet-js-aspxclientfilemanager-007b350a.md

latest2.0 KB
Original Source

ASPxClientFileManager.GetSelectedItems Method

Returns an array of the file manager’s selected items.

Declaration

ts
GetSelectedItems(): ASPxClientFileManagerFile[]

Returns

TypeDescription
ASPxClientFileManagerFile[]

An DevExpress.Web.Scripts.ASPxClientFileManagerFile[] array containing the selected items.

|

Remarks

Use the GetSelectedItems method to obtain an array of the selected items within a file manager.

Example

The code sample below demonstrates how you can respond to a file manager selection change on the client side.

Note

The complete sample project is available in the DevExpress local or online demos.

javascript
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;
}
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>

See Also

File Manager

ASPxClientFileManager Class

ASPxClientFileManager Members