如何在 Telerik 的 RadMenu for Silverlight 中混合静态和动态项目?
我正在使用 Telerik 的 Silverlight 控件,并且尝试将数据绑定项附加到静态定义项的末尾。我现在正在使用以下代码:
telerikNavigation:RadMenuItem Header="Tag Categories" ItemsSource="{Binding SelectedItem.TagCategories}"
DisplayMemberPath="Code" >
<telerikNavigation:RadMenuItem Header="Create New" Command="{Binding AddNewTagCategoryCommand}" CommandParameter="{Binding SelectedTagCategory}">
<telerikNavigation:RadMenuItem.Icon>
<Image Style="{StaticResource ImageAddSmall}" />
</telerikNavigation:RadMenuItem.Icon>
</telerikNavigation:RadMenuItem>
<telerikNavigation:RadMenuItem Header="Manage">
<telerikNavigation:RadMenuItem.Icon>
<Image Style="{StaticResource ImageEditSmall}"/>
</telerikNavigation:RadMenuItem.Icon>
</telerikNavigation:RadMenuItem>
<telerikNavigation:RadSeparator />
不幸的是,它用 ItemsSource 中的项目覆盖了我的静态定义项目(“创建新项目”和“管理”)。有什么办法可以让两者很好地放在一起吗?
I'm using Telerik's controls for Silverlight and I'm trying to get my data bound items to append to the end of my statically defined ones. I'm using the following code right now:
telerikNavigation:RadMenuItem Header="Tag Categories" ItemsSource="{Binding SelectedItem.TagCategories}"
DisplayMemberPath="Code" >
<telerikNavigation:RadMenuItem Header="Create New" Command="{Binding AddNewTagCategoryCommand}" CommandParameter="{Binding SelectedTagCategory}">
<telerikNavigation:RadMenuItem.Icon>
<Image Style="{StaticResource ImageAddSmall}" />
</telerikNavigation:RadMenuItem.Icon>
</telerikNavigation:RadMenuItem>
<telerikNavigation:RadMenuItem Header="Manage">
<telerikNavigation:RadMenuItem.Icon>
<Image Style="{StaticResource ImageEditSmall}"/>
</telerikNavigation:RadMenuItem.Icon>
</telerikNavigation:RadMenuItem>
<telerikNavigation:RadSeparator />
Unfortunately it's overwriting my statically defined items ("Create New" and "Manage") with the ones off of the ItemsSource. Is there some way to get both to place nice together?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大量调查,我发现RadMenu不支持同一级别的静态和动态项目混合。最好的解决方法是创建一个子菜单来保存动态项目并从静态项目链接到它。
After a lot of investigation, I found out that the RadMenu does not support the mixing of static and dynamic items at the same level. The best workaround is to create a submenu to hold your dynamic items and link to it from your static items.