How can I make RadDropdownMenu shorter by theme?

5 posts, 0 answers
  1. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 04 Jul 2014 Link to this post

    I want to short the width of RadDropdownMenuItem,  but after i set the MaxSize, a horizontal scroll bar was shown, very ugly. 

    Q1.jpg   it is I want to, this is the design.
    Q2.jpg   I set Maxsize to force menuitem shorter.
  2. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 04 Jul 2014 Link to this post

    PS,
            Q1. jpg is the design picture drawn by photoshop.  
            Q2.jpg is the question.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 09 Jul 2014 Link to this post

    Hello Jacky,

    Thank you for writing.

    Could you please specify what is the exact control that you are currently using to host the items (is it a context menu or drop down button)? I am asking this since I cannot determine it by the picture and the solution will depend on that.

    I am looking forward to your reply.
     
    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 09 Jul 2014 Link to this post

    RadContextMenu
  6. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 14 Jul 2014 Link to this post

    Hello Jacky,

    Thank you for writing back.

    It is possible to resize the items in the RadContextMenu and hide the vertical/horizontal scroll bars via code:
    public Form1()
    {
        InitializeComponent();
     
        for (int i = 0; i < 5; i++)
        {
            RadMenuItem item = new RadMenuItem("Item." + i);
            item.FillPrimitive.BackColor = Color.FromArgb(238, 238, 238);
            item.Padding = new Padding(-20,0,0,0);
            this.radContextMenu1.Items.Add(item);
        }
        
        this.radContextMenu1.DropDown.PopupElement.MaxSize = new Size(50, this.radContextMenu1.DropDown.PopupElement.Size.Height);
        RadDropDownMenuElement dropdown = this.radContextMenu1.DropDown.PopupElement as RadDropDownMenuElement;
     
        dropdown.ScrollPanel.HorizontalScrollState = ScrollState.AlwaysHide;
        dropdown.ScrollPanel.VerticalScrollState = ScrollState.AlwaysHide;
    }

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready