Limit number of files that can be uploaded

5 posts, 0 answers
  1. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 09 Jan 2013 Link to this post

    Hi

    The Upload function of RadEditor Image Manager is a great convenience feature for developers, but I would like to simplify the upload dialog a little for my inexperienced users by showing a single select box in the first instance, instead of the three that show by default. How can I best do this?

    There doesn't seem to be a property of the image manager for this.

    Thanks

    Clive

    Q2 2010 version of the controls on asp.net 4.0
  2. Rumen
    Admin
    Rumen avatar
    14080 posts

    Posted 09 Jan 2013 Link to this post

    Hello,

    You can see how to implement this feature in this KB article: Displaying single upload control in the FileBrowser Upload manager.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 26 Feb 2013 Link to this post

    Hi

    Thanks for this, which works as expected.  

    It would be nice to remove the 'Remove' link and the 'Add' button, so keep the UI as simple as possible.
    Is it possible to do this also?

    Thanks

    Clive
  4. Rumen
    Admin
    Rumen avatar
    14080 posts

    Posted 27 Feb 2013 Link to this post

    Hi Clive,

    Yes, after getting a reference to the Upload control () you can set the rfe.Upload.ControlObjectsVisibility enum property and display only the desired buttons of RadUpload. You can find more information in this help article: Configure the UI of RadUpload.

    Regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 27 Feb 2013 Link to this post

    Hi Rumen

    Thanks - That's perfect! So for reference of anyone else, I added a line into the ascx user control shown in the article Displaying single upload control in the FileBrowser Upload manager that you referenced, as below.

    Thanks a lot

    Clive


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
     
    public partial class EditorControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, System.EventArgs args)
        {
            Telerik.Web.UI.RadFileExplorer rfe = (Telerik.Web.UI.RadFileExplorer)this.FindRadControl(this.Page);
            if (rfe != null)
            {
                rfe.Upload.MaxFileInputsCount = 1;
    // ADDED THIS LINE BELOW to show only the clear button
                rfe.Upload.ControlObjectsVisibility = ControlObjectsVisibility.ClearButtons; 
            }
        }
     
     
     
        private Control FindRadControl(Control parent)
        {
            foreach (Control c in parent.Controls)
            {
     
                if (c is Telerik.Web.UI.RadFileExplorer) return c;
                if (c.Controls.Count > 0)
                {
                    Control sub = FindRadControl(c);
                    if (sub != null) return sub;
                }
            }
            return null;
        
    }
Back to Top