+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / Select an item - Files

Select an item - Files

4 posts, 0 answered
  1. Scott
    Scott avatar
    4 posts
    Registered:
    27 May 2010
    17 Nov 2010
    Link to this post

    Anyway to display more than 10 files at a time when trying to select from a previously uploaded item on the server?  See attached image.  If your filename begins with a 'm' - it will take forever to retrieve it through this process.

    Thank you - 

    Michael

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Nov 2010
    Link to this post
    Hello Michael,

    You have to substitute UrlWebEditor control declared in   ~/Sitefnity/Admin/ControlTemplates/Libraries/Dialogs/ItemSelector.ascx. UrlWebEditor control populates the folders in grid structure.


    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Text;
    usingTelerik.Cms.Web.UI;
    usingSystem.Drawing.Design;
    usingSystem.IO;
    usingSystem.Web.UI.HtmlControls;
    usingTelerik.FileManager;
      
    /// <summary>
    /// Summary description for UrlWebEditorCustom
    /// </summary>
    ///
    namespaceSitefinity.Samples
    {
        publicclassUrlWebEditorCustom : Telerik.FileManager.UrlWebEditor
        {
            publicUrlWebEditorCustom()
            {
      
            }
      
            protectedoverridevoidCreateChildControls()
            {
                // base.CreateChildControls();
      
                this.Controls.Clear();
      
                this.manageFiles = newManageFiles();
                FilesGrid fg = managerFiles.Controls[1] as FilesGrid;
                // here get the RadGrid from files grid collection and set its page size
     
                this.manageFiles.SetFilesGridColumnVisibility(false, false, false);
                this.manageFiles.SelectedFolderChanged += newTelerik.FileManager.FileSystemEventHandler(manageFiles_SelectedFolderChanged);
                this.Controls.Add(this.manageFiles);
            }
      
            voidmanageFiles_SelectedFolderChanged(objectsource, Telerik.FileManager.FileSystemEventArgs e)
            {
                base.OnValueChanged(newTelerik.Cms.Web.UI.ValueChangedEventArgs(e.Path));
            }
      
            privateManageFiles manageFiles;
        }
    }

    Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\ItemSelector.ascx

    <telerik:RadPageViewrunat="server"ID="pageViewFiles">
           <divid="fileManagerWrapepr">
      <ccEditor:UrlWebEditorCustomrunat="server"ID="urlWebEditor"/>  
           <%--<cc:UrlWebEditorid="urlWebEditor"runat="server"/>--%></div>
           <scripttype="text/javascript">
               var fmWrapper = document.getElementById("fileManagerWrapepr");
               if (typeof fmWrapper != 'undefined' && fmWrapper != null) {
                   var fmBody = fmWrapper.getElementsByTagName("TABLE")[0];
                   if (typeof fmBody != 'undefined' && fmBody != null) {
                       var TRs = fmBody.getElementsByTagName("TR");
      
                       for (var i = 0; i < TRs.length; i++) {
                           var folders= TRs[i].getElementsByTagName("A");
                           if (folders.length == 0)
                               TRs[i].onclick= function() {
                                   switchClasses(1, "show", "hidden", 'doneActions');
                                   switchClasses(1, "hidden", "show", 'actionsDisabled');
                               }
                       }
                   }
               }
           </script>
       </telerik:RadPageView>


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Scott
    Scott avatar
    4 posts
    Registered:
    27 May 2010
    07 Dec 2010
    Link to this post
    Substituting the editor works, however, I am having some trouble actually making the change on the number of items to show. I don't see a property or method under FilesGrid that allows you to set the page size.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Dec 2010
    Link to this post
    Hi Michael,

    You have to get the container  of FilesGrid and find the RadGrid inside it. Then set the page size.

    FilesGrid fg = manageFiles.Controls[1] as FilesGrid;
    // get the container
    var rd = fg.Controls[2];
    // get the radgrid
    ((Telerik.Web.UI.RadGrid)rd.Controls[0]).PageSize = 20;

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered