Back to Devexpress

DashboardDesignerBarExtensions.GetDashboardRibbonPage(RibbonControl, Type, DashboardRibbonPage) Method

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesignerbarextensions-dot-getdashboardribbonpage-x28-devexpress-dot-xtrabars-dot-ribbon-dot-ribboncontrol-system-dot-type-devexpress-dot-dashboardwin-dot-dashboardribbonpage-x29.md

latest4.4 KB
Original Source

DashboardDesignerBarExtensions.GetDashboardRibbonPage(RibbonControl, Type, DashboardRibbonPage) Method

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

Declaration

csharp
public static RibbonPage GetDashboardRibbonPage(
    this RibbonControl ribbonControl,
    Type customItemMetadataType,
    DashboardRibbonPage page
)
vb
<ExtensionAttribute>
Public Shared Function GetDashboardRibbonPage(
    ribbonControl As RibbonControl,
    customItemMetadataType As Type,
    page As DashboardRibbonPage
) As RibbonPage

Parameters

NameTypeDescription
ribbonControlRibbonControl

A Ribbon toolbar used in the Dashboard Designer.

| | customItemMetadataType | Type |

A metadata type that corresponds to a CustomItemMetadata class descendant.

| | page | DashboardRibbonPage |

A Ribbon page.

|

Returns

TypeDescription
RibbonPage

A Ribbon page that meets the specified parameters.

|

Remarks

Use the GetDashboardRibbonPage method to identify a Ribbon page.

The following code snippet shows how to remove a bar item from the Ribbon’s Data contextual page for the custom Simple Table item:

csharp
using DevExpress.DashboardWin;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using System.Windows.Forms;

namespace TutorialsCustomItems {
    public partial class Form1 : Form {
      public Form1() {
          InitializeComponent();
          dashboardDesigner1.CreateRibbon();
          dashboardDesigner1.LoadDashboard(@"..\..\Data\TutorialCustomItems.xml");
          dashboardDesigner1.CreateCustomItemBars();
          RemoveDrillDownBarItem();
      }

      void RemoveDrillDownBarItem() {
            RibbonPage page = dashboardDesigner1.Ribbon.GetDashboardRibbonPage(typeof(SimpleTableMetadata), DashboardRibbonPage.Data);
            RibbonPageGroup interactivityGroup = page.Groups[1];
            BarItem drillDownBarItem = interactivityGroup.ItemLinks[2].Item;
            interactivityGroup.ItemLinks.Remove(drillDownBarItem);
        }
    }
}
vb
Imports DevExpress.DashboardWin
Imports DevExpress.XtraBars
Imports DevExpress.XtraBars.Ribbon
Imports System.Windows.Forms

Namespace TutorialsCustomItems
    Partial Public Class Form1
        Inherits Form
      Public Sub New()
          InitializeComponent()
          dashboardDesigner1.CreateRibbon()
          dashboardDesigner1.LoadDashboard("..\..\Data\TutorialCustomItems.xml")
          dashboardDesigner1.CreateCustomItemBars()
          RemoveDrillDownBarItem()
      End Sub

      Private Sub RemoveDrillDownBarItem()
            Dim page As RibbonPage = dashboardDesigner1.Ribbon.GetDashboardRibbonPage(GetType(SimpleTableMetadata), DashboardRibbonPage.Data)
            Dim interactivityGroup As RibbonPageGroup = page.Groups(1)
            Dim drillDownBarItem As BarItem = interactivityGroup.ItemLinks(2).Item
            interactivityGroup.ItemLinks.Remove(drillDownBarItem)
      End Sub
    End Class
End Namespace

See Also

DashboardDesignerBarExtensions Class

DashboardDesignerBarExtensions Members

DevExpress.DashboardWin Namespace