views:

642

answers:

1

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.....

+3  A: 

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);
Francis B.
Very Nice! Thank you! Out of curiosity, what kind of controls have you embedded in a NavBar?
Refracted Paladin
@Refracted Paladin: ImageListBoxControl, TreeList, Our own custom control. Since you can add any control in the group contrainer, the possibilities are infinite.
Francis B.