将子项目添加到 DevExpress XtraNavBar

发布于 2024-08-02 11:43:59 字数 657 浏览 1 评论 0原文

我正在使用 DevExpress 的 XtraNavBar,我想弄清楚如何将子项目添加到现有项目。

我已将组和项目添加到这些组中,但我无法弄清楚如何将子项目添加到项目中。

还有其他人这样做过吗?可以通过代码或其他方式完成吗?


(供参考)

产品页面

功能页面


编辑

我发现一个方法,这里,但我希望有我想还有另一种方式。构建一个单独的控件(我猜)并嵌入它并不是我希望的答案......

I am using the XtraNavBar from DevExpress and I would like to figure out how to add a child item to an existing item.

I have added Groups and Items to those Groups but I have been unable to figure out how to add child items to the Items.

Has anyone else done this? Can it be done either through code or any other way?


(for reference)

Product Page

Feature Page


Edit

I found ONE way to do this, HERE, but I was hoping there was another way, I guess. Building a separate control (TreeView I'd guess) and embedding it was not the answer I was HOPING for.....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

胡大本事 2024-08-09 11:43:59

将 XtraNavBar 视为视图列表,其中 NavBarGroup 代表一个视图。这就是为什么您无法将孩子添加到组中的原因。

在我们的一个应用程序中,我们正在使用此控件。每个 NavBarGroup 都有一个容器,其中包含更复杂的控件。

这是我们如何做到这一点的一个简单示例:

//Create the group control container
NavBarGroupControlContainer groupContainer = new NavBarGroupControlContainer();
NavBarGroup group = new NavBarGroup("GroupName");
group.SmallImage  = new Icon("YourIcon.ico");
group.GroupStyle  = NavBarGroupStyle.ControlContainer;

m_navBar.Controls.Add(groupContainer);
group.ControlContainer = groupContainer;
group.Visible = true;

customControl.Dock = DockStyle.Fill;
groupContainer.Controls.Add(customControl);

See the XtraNavBar as a list of views where a NavBarGroup represents a view. That's why you cannot add child to a group.

In one of our applications, we are using this control. Each NavBarGroup has a container which contains a more sophisticated control.

Here a simple example how we do it:

//Create the group control container
NavBarGroupControlContainer groupContainer = new NavBarGroupControlContainer();
NavBarGroup group = new NavBarGroup("GroupName");
group.SmallImage  = new Icon("YourIcon.ico");
group.GroupStyle  = NavBarGroupStyle.ControlContainer;

m_navBar.Controls.Add(groupContainer);
group.ControlContainer = groupContainer;
group.Visible = true;

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