Skip to main content

DashboardDesignerBarExtensions.GetDashboardRibbonPage(RibbonControl, DashboardBarItemCategory, DashboardRibbonPage) Method

Returns a page from the Ribbon toolbar used in the Dashboard Designer.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v24.1.Win.dll

NuGet Package: DevExpress.Win.Dashboard

Declaration

public static RibbonPage GetDashboardRibbonPage(
    this RibbonControl ribbonControl,
    DashboardBarItemCategory itemCategory,
    DashboardRibbonPage page
)

Parameters

Name Type Description
ribbonControl RibbonControl

A Ribbon toolbar used in the Dashboard Designer.

itemCategory DashboardBarItemCategory

A Ribbon page category that contains commands related to a particular dashboard item.

page DashboardRibbonPage

A Ribbon page.

Returns

Type Description
RibbonPage

A Ribbon page that meets the specified parameters.

Remarks

Use the GetDashboardRibbonPage method to identify a Ribbon page.

For example, you can add new control elements to the current Ribbon instance. The following code snippet shows how to add the Dashboard Description button to the Dashboard group on the Dashboard’s Home page:

using DevExpress.DashboardWin;
using DevExpress.DashboardWin.Localization;
using DevExpress.Utils.Svg;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon; 

namespace WimForms_Dashboard {
    public partial class Form1 : RibbonForm {
        public Form1(){
            InitializeComponent();
            dashboardDesigner1.CreateRibbon();
            RibbonControl ribbon = dashboardDesigner1.Ribbon;
            RibbonPage page = ribbon.GetDashboardRibbonPage(DashboardBarItemCategory.None, DashboardRibbonPage.Home);
            RibbonPageGroup group = page.Groups.GetGroupByText(DashboardWinLocalizer.GetString(DashboardWinStringId.RibbonPageDashboardCaption));
            BarButtonItem barItem = CreateBarItem("Dashboard Description", svgImageCollection1["barImage"]);
            group.ItemLinks.Add(barItem);
        }
        BarButtonItem CreateBarItem(string caption, SvgImage barImage){
            BarButtonItem barItem = new BarButtonItem();
            barItem.Caption = caption;
            barItem.ImageOptions.SvgImage = barImage;
            return barItem;
        }
    }
}
See Also