Back to Devexpress

ASPxClientFileManager.SelectionChanged Event

aspnet-js-aspxclientfilemanager-72fae6cd.md

latest3.1 KB
Original Source

ASPxClientFileManager.SelectionChanged Event

Fires after the selection has been changed.

Declaration

ts
SelectionChanged: ASPxClientEvent<ASPxClientFileManagerSelectionChangedEventHandler<ASPxClientFileManager>>

Event Data

The SelectionChanged event's data class is ASPxClientFileManagerSelectionChangedEventArgs. The following properties provide information specific to this event:

PropertyDescription
fullNameGets the full name of the file currently being processed.
isSelectedGets whether the item has been selected.
itemGets the file manager item object related to the event.
nameGets the name of the currently processed file.

Remarks

The ASPxFileManager allows multiple files to be selected. End-users can select/deselect files by clicking them. Handle the SelectionChanged event to respond to a selection change.

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

FocusedItemChanged

File Manager

ASPxClientFileManager Class

ASPxClientFileManager Members