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

Can a RadMenu have multiple ItemSources?

1 Answer 36 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 20 Jan 2010, 01:00 PM
I have a RadMenu in my application where I would like to have the ItemsSource property "partially bound" to some data object and have a few extra items thrown on top.  The important part here is to use binding somehow so that when the list changes, the partially bound part of the menu changes.

My eventual goal would be to have a list of static menu items (New, Open), a separator, and then a bound list of dynamic items (a list of recently used files) like the following...   As users are navigating to files, the list of recently used files would be changing and I would like that to be updated via binding...

File (TopLevel)
 -New
 -Open
 ---separator---
 -RecentFile1
 -RecentFile2
 -RecentFile3
 ...
Is there a way to do this neatly?

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 21 Jan 2010, 08:51 AM
Hello Rob,

Adding multiple ItemSources is not an option here. But you can easily modify the collection that you set as ItemsSource. This will allow you to use databinding and dynamic source for sub menuitems.
As you know RadMenu is hierarchical control so you can use HierarchicalDataTemplate to specify the source for the sub menuitems.
You can find a demo here:
http://demos.telerik.com/silverlight/#Menu/DataBinding

Let us know if you need more information.

Kind regards,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Menu
Asked by
Rob
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or