如何在 Telerik 的 RadMenu for Silverlight 中混合静态和动态项目?

发布于 2024-12-27 17:52:57 字数 990 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深空失忆 2025-01-03 17:52:57

经过大量调查,我发现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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文