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

Forums / Developing with Sitefinity / how to change ItemsPerPage in File Tabs(generic content-document manager-files tab)?

how to change ItemsPerPage in File Tabs(generic content-document manager-files tab)?

9 posts, 0 answered
  1. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    09 Jun 2011
    Link to this post
    HI,
    how to change ItemsPerPage to 100 in File Tabs(generic content-document manager-files tab) ? please the see the attachment for clarity. How to solve this ? here is my code .

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Telerik.Cms.Web.UI;
    using System.Drawing.Design;
    using System.IO;
    using System.Web.UI.HtmlControls;
    using Telerik.FileManager;
    using Telerik.FileManager.WebControls;
    using System.Web;
    using System.Security.AccessControl;
    using Telerik.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI;
     
    /// <summary>
    /// Summary description for UrlWebEditorCustom
    /// </summary>
    namespace Telerik.FileManager.Custom
    {
        public class UrlWebEditorCustom : Telerik.FileManager.UrlWebEditor
        {
            DirectoryInfo a = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/SlideData/"));
     
            public UrlWebEditorCustom()
            {
                //
                // TODO: Add constructor logic here
                //
            }
     
            protected override void CreateChildControls()
            {
     
                this.Controls.Clear();
                this.manageFiles = new ManageFiles(HttpContext.Current.Server.MapPath("~/SlideData/"));
                this.manageFiles.SetFilesGridColumnVisibility(false, false, false);
                // here get the RadGrid from files grid collection and set its page size
                FilesGrid fg = manageFiles.Controls[1] as FilesGrid;
                // get the container
                var rd = fg.Controls[2];
                // get the radgrid
                Telerik.Web.UI.RadGrid radgridid = ((Telerik.Web.UI.RadGrid)rd.Controls[0]);
                //radgridid.PageSize = 100000;
                this.manageFiles.SelectedFolder = a;
                this.Controls.Add(this.manageFiles);
     
            }
     
     
            protected override void OnPreRender(EventArgs e)
            {
                base.OnPreRender(e);
                if (a.Parent.Name == this.manageFiles.SelectedFolder.Name)
                {
                    this.manageFiles.Controls.Clear();
                    this.manageFiles.SelectedFolder = a;
                    this.Controls.Clear();
                    this.Controls.Add(this.manageFiles);
                }
     
            }
     
     
     
     
     
            private ManageFiles manageFiles;
     
     
     
        }
    }
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    13 Jun 2011
    Link to this post
    Hello humayoo,

    You need to set the PageSize of the filesGrid. You can access the RadGrid that is wrapped inside FilesGrid using the controls collection


    sample


    filesGrid.Controls[2].Controls[0] as RadGrid 

    or traversing through FilesGridControls container.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    14 Jun 2011
    Link to this post
    HI,

    please see my code which i pasted in my post. i did same thing as you said filesGrid.Controls[2].Controls[0] as RadGrid  . but problem occur when i upload new file, then again page size(ItemsPerPage) changes to default page size(ItemsPerPage)  10. please see my code and provide me some example or code how to solve this problem ?


    thanks
  4. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    24 Jun 2011
    Link to this post
    HI,

    its urgent .please reply as soon as possible. please see my code below which i try.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Telerik.Cms.Web.UI;
    using System.Drawing.Design;
    using System.IO;
    using System.Web.UI.HtmlControls;
    using Telerik.FileManager;
    using Telerik.FileManager.WebControls;
    using System.Web;
    using System.Security.AccessControl;
    using Telerik.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI;
     
    /// <summary>
    /// Summary description for UrlWebEditorCustom
    /// </summary>
    namespace Telerik.FileManager.Custom
    {
        public class UrlWebEditorCustom : Telerik.FileManager.UrlWebEditor
        {
            DirectoryInfo a = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/SlideData/"));
     
            public UrlWebEditorCustom()
            {
                //
                // TODO: Add constructor logic here
                //
            }
     
            protected override void CreateChildControls()
            {
     
                this.Controls.Clear();
                this.manageFiles = new ManageFiles(HttpContext.Current.Server.MapPath("~/SlideData/"));
                this.manageFiles.SetFilesGridColumnVisibility(false, false, false);
                // here get the RadGrid from files grid collection and set its page size
                FilesGrid fg = manageFiles.Controls[1] as FilesGrid;
                // get the container
                var rd = fg.Controls[2];
                // get the radgrid
                Telerik.Web.UI.RadGrid radgridid = ((Telerik.Web.UI.RadGrid)rd.Controls[0]);
                radgridid.PageSize = 200;
                this.manageFiles.SelectedFolder = a;
                this.Controls.Add(this.manageFiles);
     
            }
     
     
            protected override void OnPreRender(EventArgs e)
            {
                base.OnPreRender(e);
                if (a.Parent.Name == this.manageFiles.SelectedFolder.Name)
                {
                    this.manageFiles.Controls.Clear();
                    this.manageFiles.SelectedFolder = a;
                    this.Controls.Clear();
                    this.Controls.Add(this.manageFiles);
                }
     
            }
     
     
     
     
     
            private ManageFiles manageFiles;
     
     
     
        }
    }
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Jun 2011
    Link to this post
    Hi humayoo,

    Here is a code that changes RadGrid's PageSize property. I attached a short video that clearly shows that there are over 10 items on a page.

    using Telerik.FileManager.WebControls;
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Telerik.Cms.Web.UI;
    using System.Drawing.Design;
    using System.IO;
    using System.Web.UI.HtmlControls;
    using Telerik.FileManager;
    using Telerik.Web.UI;
       
    /// <summary>
    /// Summary description for UrlWebEditorCustom
    /// </summary>
    ///
    namespace Sitefinity.Samples
    {
        public class UrlWebEditorCustom : Telerik.FileManager.UrlWebEditor
        {
            
            protected override void CreateChildControls()
            {
                this.Controls.Clear();
       
                this.manageFiles = new ManageFiles();
                FilesGrid fg = manageFiles.Controls[1] as FilesGrid;
                 // here get the RadGrid from files grid collection and set its page size
                var grid = fg.Controls[2].Controls[0] as RadGrid;
                grid.PageSize = 100;
                this.manageFiles.SetFilesGridColumnVisibility(false, false, false);
                
                this.manageFiles.SelectedFolderChanged += new Telerik.FileManager.FileSystemEventHandler(manageFiles_SelectedFolderChanged);
                this.Controls.Add(this.manageFiles);
            }
       
            void manageFiles_SelectedFolderChanged(object source, Telerik.FileManager.FileSystemEventArgs e)
            {
                base.OnValueChanged(new Telerik.Cms.Web.UI.ValueChangedEventArgs(e.Path));
            }
       
            private ManageFiles manageFiles;
        }
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    30 Jun 2011
    Link to this post
    hi,

    thanks for Reply.
    1. i am using sitefinity 3.7. it works in normal condition. but when rename or create new folder. paging did not work. it again back to default 10.

    2. rename of folder is also not working.

    please see the attachment.


    thanks
    Humayoo
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    30 Jun 2011
    Link to this post
    Hi Humayoo,

    You can try to set the pager on a later stage of the control lifecycle in this case, since something overrides the settings in CreateChildControls.
    Another option would be wrapping RadFileExplored in a custom WebUITypeEditor.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    30 Jun 2011
    Link to this post
    Hi,

    thanks for reply. please provide me some example or reference. i tried so much things but not get success yet.

    thanks
    Humayoo
  9. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    10 Jul 2011
    Link to this post
    HI,

    i solved the issue if anybody need help, please contact me.

    thanks
    Humayoo
Register for webinar
9 posts, 0 answered