Skip to main content

RibbonForm.NavigationControl Property

Gets or sets the navigation control as a side navigation element. The side navigation control must be docked to the left edge of the Ribbon Form.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v25.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(null)]
[DXCategory("Appearance")]
public virtual Control NavigationControl { get; set; }

Property Value

Type Default Description
Control null

The navigation control.

Remarks

The NavigationControl property accepts the following DevExpress navigation controls:

Use the NavigationControlLayoutMode property to align the side navigation relative to the form’s title.

Note

The navigation control disables the Ribbon’s Full Screen mode.

The following code snippet creates a side navigation inspired by the new Microsoft Outlook:

using DevExpress.XtraBars.Navigation;
using DevExpress.XtraBars.Ribbon;
using System.Windows.Forms;

namespace DXApplication {
    public partial class Form1 : RibbonForm {
        AccordionControl accordion;
        public Form1() {
            InitializeComponent();
            accordion = new AccordionControl() { Dock = DockStyle.Left };
            this.Controls.Add(accordion);
            this.NavigationControl = accordion;
            this.NavigationControlLayoutMode = RibbonFormNavigationControlLayoutMode.StretchToFormTitle;
            CreateAccordionItems();
        }
        void CreateAccordionItems() {
            AccordionControlElement group1 = new AccordionControlElement(ElementStyle.Group) {
                Name = "group1",
                Text = "Contacts",
                Expanded = true
            };
            AccordionControlElement item1 = new AccordionControlElement(ElementStyle.Item) {
                Name = "itemCustomers",
                Text = "Customers",
            };
            AccordionControlElement item2 = new AccordionControlElement(ElementStyle.Item) {
                Name = "itemEmployees",
                Text = "Employees"
            };

            group1.Elements.AddRange(new AccordionControlElement[] { item1, item2 });
            accordion.Elements.Add(group1);
        }
    }
}
See Also