Vertical Scroll bar not working for RadMenuItem

6 posts, 1 answers
  1. Sravanthi
    Sravanthi avatar
    6 posts
    Member since:
    May 2013

    Posted 09 May 2013 Link to this post

    How to dynamically give vertical scroll bar inside RadMenuItem. Below is my code.

          RadMenuItem subMenu = new RadMenuItem();
                        foreach (GridViewColumn column in grid.Columns)
                        {
                            subMenu = new RadMenuItem();
                     subMenu.Header = column.Header;        
                            subMenu.IsCheckable = true;
                            subMenu.IsChecked = true;
                            Binding isCheckedBinding = new Binding("IsVisible");
                            isCheckedBinding.Mode = BindingMode.TwoWay;
                            isCheckedBinding.Source = column;
                            subMenu.SetBinding(RadMenuItem.IsCheckedProperty, isCheckedBinding);
                            item.Items.Add(subMenu);
                        }
    System.Windows.Controls.ScrollViewer.SetVerticalScrollBarVisibility(subMenu, System.Windows.Controls.ScrollBarVisibility.Visible);
  2. Answer
    Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 09 May 2013 Link to this post

    Hi Sravanthi,

    I'm not sure I fully understand your idea. If you want to have VerticalScrollBar for your RadMenuItem, you should put it inside the header. RadMenuItem's header is of type object so you can put whatever you need.
    If you want to have scrollbar for the submenu items (for example if you have a lot of items and you want to scroll through all of them), you can check this article for more information how to achieve it.

    Hopefully this helps.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Sravanthi
    Sravanthi avatar
    6 posts
    Member since:
    May 2013

    Posted 10 May 2013 Link to this post

    Please help me to fix the issue. I have a RadGridView with 40 Columns and when I right click on Header of any column it will show Choose Columns,Sorting Asc, Sorting Desc in Menu and when I select Choose Columns it is showing all the columns in sub menu. But I am unable to scroll down. It is showing 28 columns in the page remaining 12 Columns are down the screen. here iam unable to see remaining 12 Columns and unable to scroll down.

    Please help me. I am struck with this issue since 2 days.




  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 13 May 2013 Link to this post

    Hi Sravanthi,

    I'm sending you a project demonstrating how to achieve this. The project is created based on this article. Please note that with our next official release we'll have integrated scrolling functionality inside RadContextMenu, so there will be no need to modify the templates.

    Please check the attachment and inform us if you have any problems or concerns.

    Greetings,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Sravanthi
    Sravanthi avatar
    6 posts
    Member since:
    May 2013

    Posted 15 May 2013 Link to this post

    Thank you for the reply Rosan. I saw the code which you sent. I need to same created context menu and Submenu dynamically from code behind and give vertical scroll bar to submenu items.

    Please help me to solve this issue

    Thanks,
    Sravanthi
  7. Sravanthi
    Sravanthi avatar
    6 posts
    Member since:
    May 2013

    Posted 15 May 2013 Link to this post

    Thank you so much Rosan. Finally I fixed the issue by dynamically creating menu and submenu..
Back to Top
UI for WPF is Visual Studio 2017 Ready