Back to Devexpress

DashboardItem.ComponentName Property

dashboard-devexpress-dot-dashboardcommon-dot-dashboarditem.md

latest8.2 KB
Original Source

DashboardItem.ComponentName Property

Gets or sets the component name of the dashboard item.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
[DefaultValue(null)]
public string ComponentName { get; set; }
vb
<DefaultValue(Nothing)>
Public Property ComponentName As String

Property Value

TypeDefaultDescription
Stringnull

A String that specifies the component name of the dashboard item.

|

Remarks

The component name of the dashboard item is used in code to identify the dashboard item object. Use this name when calling the DashboardViewer.SetMasterFilter or DashboardViewer.PerformDrillDown methods.

The Name is displayed in the dashboard item caption. It does not have to be unique.

The ComponentName identifies a dashboard item in a dashboard container. It has to be unique in the dashboard. You can use only letters (A-Z, a-z), numbers (0-9), and the underscore symbol (_) to set a component name. The component name should start with a letter.

Tip

Set the DashboardDesigner.AllowEditComponentName property to true to allow changing the item’s ComponentName in the dashboard designer, as shown in the picture below.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ComponentName property.

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-designer-merge-dashboards-to-tabs/CS/DashboardMerger/ItemsMerger.cs#L32

csharp
DashboardItemGroup groupCopy = CreateGroupCopy(originalGroup);
if(toGroups.Any(g => g.ComponentName == originalGroup.ComponentName)) {
    if(ResolveGroupNamesConflict(groupCopy, originalGroup.ComponentName, toGroups, dashboardMerger.GroupNamesMap))

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/CS/MultiPaneExtension/MultiPaneModule.cs#L205

csharp
string status = settings.MultiPaneEnabled == true ? "enabled" : "disabled";
CustomPropertyHistoryItem historyItem = new CustomPropertyHistoryItem(dashboardItem, customPropertyName, settings.ToJson(), $"Autogenerate Panes for {dashboardItem.ComponentName} is {status}");
dashboardDesigner.AddToHistory(historyItem);

winforms-dashboard-window-calculation-example/CS/WindowCalculationExample/TabPageLoadHelper.cs#L28

csharp
targetDashboard.Items.Add(destinationParentContainer);
TabContainerName = destinationParentContainer.ComponentName;

winforms-dashboard-customize-title-and-item-captions/CS/CustomizeDashboardItemCaptionExample/ViewerForm1.cs#L32

csharp
foreach (var item in viewer.Dashboard.Items) {
    if (viewer.CanSetMasterFilter(item.ComponentName)) {
        var filterValues = viewer.GetCurrentFilterValues(item.ComponentName);

dashboard-constant-lines/CS/ConstantLineExtension.WPF/ConstantLinesConverter.cs#L46

csharp
{
    MultiDimensionalData data = provider.GetItemData(chartItem.ComponentName);
    MeasureDescriptor measure = data.GetMeasures().FirstOrDefault(m => m.ID == customConstantLine.MeasureId);

winforms-dashboard-designer-merge-dashboards-to-tabs/VB/DashboardMerger/ItemsMerger.vb#L36

vb
Dim groupCopy As DashboardItemGroup = CreateGroupCopy(originalGroup)
If toGroups.Any(Function(g) g.ComponentName = originalGroup.ComponentName) Then
    If ResolveGroupNamesConflict(groupCopy, originalGroup.ComponentName, toGroups, dashboardMerger.GroupNamesMap) Then

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/VB/MultiPaneExtension/MultiPaneModule.vb#L176

vb
Dim status As String = If(settings.MultiPaneEnabled = True, "enabled", "disabled")
Dim historyItem As New CustomPropertyHistoryItem(dashboardItem, customPropertyName, settings.ToJson(), $"Autogenerate Panes for {dashboardItem.ComponentName} is {status}")
dashboardDesigner.AddToHistory(historyItem)

winforms-dashboard-window-calculation-example/VB/WindowCalculationExample/TabPageLoadHelper.vb#L57

vb
targetDashboard.Items.Add(destinationParentContainer)
TabContainerName = destinationParentContainer.ComponentName
Dim tabPage As DashboardTabPage = CopyDashboardToTabPage(targetDashboard, originalDashboard)

winforms-dashboard-customize-title-and-item-captions/VB/CustomizeDashboardItemCaptionExample/ViewerForm1.vb#L35

vb
For Each item In viewer.Dashboard.Items
    If viewer.CanSetMasterFilter(item.ComponentName) Then
        Dim filterValues = viewer.GetCurrentFilterValues(item.ComponentName)

winforms-dashboard-viewer-tab-navigation-buttons-tab-animation/VB/DashboardNextPrevTab/ViewerForm.vb#L66

vb
Dim increment As Integer = If(value = NextPrevValue.Next, 1, -1)
Dim tabContainerName As String = tabContainer.ComponentName
Dim selectedIndex As Integer = dashboardViewer.GetSelectedTabPageIndex(tabContainerName)

See Also

Dashboard Item Caption in the WinForms Designer

DashboardItem Class

DashboardItem Members

DevExpress.DashboardCommon Namespace