Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Suggestions > Select an item - Files

Select an item - Files

  • Scott avatar

    Posted on Nov 17, 2010 (permalink)

    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

    Attached files

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Nov 17, 2010 (permalink)

    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

    Reply

  • Scott avatar

    Posted on Dec 7, 2010 (permalink)

    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.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Dec 10, 2010 (permalink)

    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

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Suggestions > Select an item - Files