Back to Devexpress

DashboardDesigner.CreateCustomItemBars(Type[]) Method

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-dot-createcustomitembars-x28-system-dot-type-x29.md

latest5.8 KB
Original Source

DashboardDesigner.CreateCustomItemBars(Type[]) Method

Adds custom item bars to the Ribbon.

Namespace : DevExpress.DashboardWin

Assembly : DevExpress.Dashboard.v25.2.Win.dll

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public void CreateCustomItemBars(
    params Type[] customItemMetadataTypes
)
vb
Public Sub CreateCustomItemBars(
    ParamArray customItemMetadataTypes As Type()
)

Parameters

NameTypeDescription
customItemMetadataTypesType[]

A metadata type that corresponds to a CustomItemMetadata class descendant.

|

Remarks

The CreateCustomItemBars method inserts a custom item’s bar into the Ribbon. Before you add a bar, make sure that you have registered the corresponding metadata type and created the Ribbon.

Call the CreateCustomItemBars method to add bars for all custom items whose metadata is registered. To add bars for the corresponding custom items, pass their metadata as the customItemMetadataTypes parameter.

csharp
using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;

namespace TutorialsCustomItems {
public partial class Form1 : Form {
  public Form1(){
      InitializeComponent();
      dashboardDesigner1.CreateRibbon();
      dashboardDesigner1.CreateCustomItemBars();
    }
  }
}
vb
Imports System.Windows.Forms
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWin

Namespace CustomItemsSample
  Partial Public Class Form1
    Inherits Form
    Public Sub New()
      InitializeComponent()
      dashboardDesigner1.CreateRibbon()
      dashboardDesigner1.CreateCustomItemBars()
    End Sub
  End Class
End Namespace

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateCustomItemBars(Type[]) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/SankeyChart/SankeyItemExtensionModule.cs#L17

csharp
AttachDashboardControl(designer);
designer.CreateCustomItemBars(typeof(SankeyItemMetadata));
RemoveDrillDownBarItem(designer);

winforms-dashboard-custom-items/CS/TutorialsCustomItems/Form1.cs#L17

csharp
dashboardDesigner1.LoadDashboard(@"..\..\Data\TutorialCustomItems.xml");
dashboardDesigner1.CreateCustomItemBars();
dashboardDesigner1.CustomizeExportDocument += dashboardDesigner1_CustomizeExportDocument;

winforms-dashboard-trend-line-indicators/CS/WinformsIndicator/FormDesigner.cs#L30

csharp
dashboardDesigner.CreateRibbon();
    dashboardDesigner.CreateCustomItemBars();
}

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/TreeList/TreeListItemExtensionModule.vb#L17

vb
AttachDashboardControl(designer)
designer.CreateCustomItemBars(GetType(TreeListItemMetadata))
RemoveDrillDownBarItem(designer)

winforms-dashboard-custom-items/VB/TutorialsCustomItems/Form1.vb#L14

vb
dashboardDesigner1.LoadDashboard("..\..\Data\TutorialCustomItems.xml")
dashboardDesigner1.CreateCustomItemBars()
AddHandler dashboardDesigner1.CustomizeExportDocument, AddressOf dashboardDesigner1_CustomizeExportDocument

winforms-dashboard-trend-line-indicators/VB/WinformsIndicator/FormDesigner.vb#L32

vb
dashboardDesigner.CreateRibbon()
    dashboardDesigner.CreateCustomItemBars()
End Sub

See Also

DashboardDesigner Class

DashboardDesigner Members

DevExpress.DashboardWin Namespace