dashboard-devexpress-dot-dashboardwin-dot-dashboarddesignerbarextensions-dot-getdashboardribbonpage-x28-ribboncontrol-dashboardbaritemcategory-dashboardribbonpage-x29.md
Returns a page from the Ribbon toolbar used in the Dashboard Designer.
Namespace : DevExpress.DashboardWin
Assembly : DevExpress.Dashboard.v25.2.Win.dll
NuGet Package : DevExpress.Win.Dashboard
public static RibbonPage GetDashboardRibbonPage(
this RibbonControl ribbonControl,
DashboardBarItemCategory itemCategory,
DashboardRibbonPage page
)
<ExtensionAttribute>
Public Shared Function GetDashboardRibbonPage(
ribbonControl As RibbonControl,
itemCategory As DashboardBarItemCategory,
page As DashboardRibbonPage
) As RibbonPage
| 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.
|
| Type | Description |
|---|---|
| RibbonPage |
A Ribbon page that meets the specified parameters.
|
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;
}
}
}
Imports DevExpress.DashboardWin
Imports DevExpress.DashboardWin.Localization
Imports DevExpress.Utils.Svg
Imports DevExpress.XtraBars
Imports DevExpress.XtraBars.Ribbon
Namespace WimForms_Dashboard
Partial Public Class Form1
Inherits RibbonForm
Public Sub New()
InitializeComponent()
dashboardDesigner1.CreateRibbon()
Dim ribbon As RibbonControl = dashboardDesigner1.Ribbon
Dim page As RibbonPage = ribbon.GetDashboardRibbonPage(DashboardBarItemCategory.None, DashboardRibbonPage.Home)
Dim group As RibbonPageGroup = page.Groups.GetGroupByText(DashboardWinLocalizer.GetString(DashboardWinStringId.RibbonPageDashboardCaption))
Dim barItem As BarButtonItem = CreateBarItem("Dashboard Description", svgImageCollection1("barImage"))
group.ItemLinks.Add(barItem)
End Sub
Private Function CreateBarItem(ByVal caption As String, ByVal barImage As SvgImage) As BarButtonItem
Dim barItem As New BarButtonItem()
barItem.Caption = caption
barItem.ImageOptions.SvgImage = barImage
Return barItem
End Function
End Class
End Namespace
See Also
DashboardDesignerBarExtensions Class