How to get selected files?
Question asked by Olivier Lefebvre - 11/10/2017 at 3:16 AM
I'm currently using FileUltimate in my MVC ASP.NET project.
Everything works quite good except that I'm unable to find the GridView element like in this old example:
https ://forums.gleamtech.com/4356/easy-way-to-get-selected-file
I would like to get the selected files and retrieve their informations.
Thank you.

4 Replies

Reply to Thread
Cem Alacayir Replied
Employee Post
You can use FileManager as a "file picker", this is demonstrated in this example:
You set the ClientChosen event:
    <GleamTech:FileManager ID="fileManager1" runat="server" 
Then you  insert your javascript event handler in the page (in <head> tag)
        function fileManagerChosen(sender, eventArgs) {
            if (eventArgs.IsCanceled) {

            var text = "ParentFullPath: " + eventArgs.ParentFullPath;
            text += "\nItems: ";
            for (var i = 0; i < eventArgs.Items.length; i++) {
                var item = eventArgs.Items[i];
                text += "\n\tName: " + item.Name;
                text += "\n\tFullPath: " + item.FullPath;
                text += "\n\tIsfolder: " + item.IsFolder;
                text += "\n";

These are the properties you may be interested in:
  • Chooser property, when set to true, displays the control as a file/folder chooser. In chooser mode, "Choose" and "Cancel" buttons will be displayed at the bottom of the control and double-clicking on a item of allowed type will choose that item instead of doing the default action (download/explore).
  • ChooserType property specifies the item type that will be allowed to be chosen in chooser mode. Possible values are FileFolder and FileOrFolder. If omitted, File will be used.
  • ChooserMultipleSelection property, when set to true, allows multiple item selections in chooser mode.
  • ClientLoadingClientLoaded and ClientChosen properties specifies the client-side events. ClientLoading is raised before control is loaded and ClientLoaded is raised after control is loaded. ClientChosen is raised after user chooses items when using chooser mode. The value should be a valid JavaScript function name which is accessible on the host page. Function names should be specified without parentheses like FunctionName or Namespace.FunctionName. Example function:

    function fileManagerLoaded(sender, eventArgs) { var fileManager = sender; }
  • ModalDialog property, when set to true, displays the control within a modal dialog which masks the parent element. If FullViewport mode is active then the modal dialog will mask the browser's viewport instead.
  • ModalDialogTitle property specifies the title of the modal dialog.
  • ShowOnLoad property, when set to false, hides the control when page is loaded. This is useful when the control will be displayed later on client-side manually. For example, the control can be displayed via a button's click event.
Olivier Lefebvre Replied
Thank you.
Cem Alacayir Replied
Employee Post Marked As Answer
FYI, as of FileUltimate v6.2.0, there is now also ClientSelectionChanged which can be used instead of ClientChosen when you are not using the Chooser mode.
Please see my reply here:
darshani jayasekara Replied
We are using FileUltimate  v4.0.3 . In this version if we are not using Chooser mode how can we get the full file path when click on  a context menu item?

Reply to Thread