This is a migrated thread and some comments may be shown as answers.

Scrollbar on a RadContextMenu

1 Answer 112 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Shashank
Top achievements
Rank 1
Shashank asked on 06 Jun 2013, 01:50 AM
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? 


1 Answer, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 07 Jun 2013, 06:35 AM
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.

Regards,
Rosen Vladimirov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ContextMenu
Asked by
Shashank
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or