Back to Devexpress

RibbonForm.SidePane Property

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-ribbonform-1fc31956.md

latest4.3 KB
Original Source

RibbonForm.SidePane Property

Gets or sets the panel to the right of the Ribbon.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Appearance")]
public Control SidePane { get; set; }
vb
<DXCategory("Appearance")>
<DefaultValue(Nothing)>
Public Property SidePane As Control

Property Value

TypeDefaultDescription
Controlnull

The panel to the right of the Ribbon.

|

Remarks

The SidePane property accepts the following DevExpress controls:

When the side panel is displayed, it shifts Ribbon content to the left.

Run Demo: Outlook-Inspired Application

Use the panel’s Visible property to display or hide the panel.

The following code snippet assigns a side panel and toggles its visibility on a bar item click:

Note

panelControl1 and barCheckItem1 were created and customized at design time.

In Code

csharp
using DevExpress.XtraBars.Navigation;
using System.Windows.Forms;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraGrid.Columns;
using DevExpress.Utils;
using DevExpress.XtraEditors.Repository;

namespace ribbonSidePane {
    public partial class Form1 : RibbonForm {
        public Form1() {

            InitializeComponent();
            // Assign a side panel
            this.SidePane = panelControl1;
            panelControl1.Visible = false;
            // Handle the "Notifications" check item's CheckedChanged event
            Notifications.CheckedChanged += Notifications_CheckedChanged;

        }

        private void Notifications_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            // Toggle side panel visibility
            this.SidePane.Visible = !this.SidePane.Visible;
        }
    }
}
vb
Imports DevExpress.XtraBars.Navigation
Imports System.Windows.Forms
Imports DevExpress.XtraBars.Ribbon
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.Utils
Imports DevExpress.XtraEditors.Repository

Namespace ribbonSidePane
    Partial Public Class Form1
        Inherits RibbonForm

        Public Sub New()

            InitializeComponent()
            ' Assign a side panel
            Me.SidePane = panelControl1
            panelControl1.Visible = False
            ' Handle the "Notifications" check item's CheckedChanged event
            AddHandler Notifications.CheckedChanged, AddressOf Notifications_CheckedChanged

        End Sub

        Private Sub Notifications_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs)
            ' Toggle side panel visibility
            Me.SidePane.Visible = Not Me.SidePane.Visible
        End Sub
    End Class
End Namespace

Notes

  • The side panel control must be added directly to the form’s Controls collection.
  • The Ribbon Form must be a window level control. If the Ribbon Form is a child control (for example, an MDI child form), the side panel control may exhibit unexpected behavior.

See Also

RibbonForm Class

RibbonForm Members

DevExpress.XtraBars.Ribbon Namespace