Scrollbar on a RadContextMenu

2 posts, 0 answers
  1. Shashank
    Shashank avatar
    4 posts
    Member since:
    Oct 2011

    Posted 05 Jun 2013 Link to this post

    I am new to Silverlight. I have a xaml which contains a picker button. On click, its calls a 'Show' function. The Showfunction is handled in the xaml.cs file. IThe showfunction displays a RadContextMenu. A listbox is added to the RadContextMenu. The RadContextMenu/Listbox does not contain a vertical scrollbar. How do I add a scrollbar? And what do I add it to, Listbox or RadContextMenu? 

  2. Rosen Vladimirov
    Rosen Vladimirov avatar
    640 posts

    Posted 07 Jun 2013 Link to this post

    Hello Shashank,

    There are several ways to achieve the desired functionality. The first option is to use RadComboBox and set its ItemsSource to use your collection. The other option is to use RadListBox inside RadContextMenu and to set the Height property of the listBox (and ScrollViewer.VerticalScrollBarVisibility to Auto). Next option is to use our new functionality which is included in our Beta release (you can download it under your account, the official release is planned for the next week) - we have implemented new menu item types - RadMenuGroupItem could help you to achieve the desired functionality. You can put the Listbox directly in RadMenuGroupItem and use our EventToCommandBehavior to close the Menu when a user selects an item in the listbox. You may also use RadDropDownButton and put RadContextMenu as DropDownContent - we've improved the integration between these two controls. The next option is to set the ItemsSource of RadContextMenu to your collection and set Height property of the menu - this will limit the popup and a scroll functionality will be added (this is available with our Beta release). To show the scrolling buttons of a submenu items, you have to set DropDownHeight property of the parent MenuItem.

    All of these features are included in the attached project. You can check it and choose the most suitable solution for your case. Feel free to contact us if you have any problems or concerns.

    Rosen Vladimirov

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top