Back to Devexpress

Dashboard.Items Property

dashboard-devexpress-dot-dashboardcommon-dot-dashboard-649e5c39.md

latest7.6 KB
Original Source

Dashboard.Items Property

Gets the collection of dashboard items.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public DashboardItemCollection Items { get; }
vb
Public ReadOnly Property Items As DashboardItemCollection

Property Value

TypeDescription
DashboardItemCollection

A collection of DashboardItem descendants. Contains dashboard items displayed within this dashboard.

|

Remarks

Add dashboard items to the Items collection to show them in the dashboard.

When a dashboard item is added or removed from the Items collection, the Dashboard.ItemCollectionChanged event is fired.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Items 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-apply-conditional-formatting-to-grid-cells/CS/Dashboard_ConditionalFormatting_Grid/BarConditionForm.cs#L9

csharp
dashboardViewer1.Dashboard = dashboard;
GridDashboardItem grid = (GridDashboardItem)dashboard.Items["gridDashboardItem1"];
GridMeasureColumn extendedPrice = (GridMeasureColumn)grid.Columns[1];

wpf-dashboard-custom-properties/CS/Wpf-Dashboard-Custom-Properties/Modules/ChartItemModule/ChartOptions/ScaleBreak.cs#L15

csharp
IDashboardControlProvider provider = (IDashboardControlProvider)values[1];
ChartDashboardItem chartItem = provider.Dashboard.Items[itemName] as ChartDashboardItem;
bool scaleBreakEnabled = System.Convert.ToBoolean(chartItem.CustomProperties[ChartItemModule.ScaleBreakPropertyName]);

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

csharp
if(e.MetadataType == typeof(SankeyItemMetadata))
        e.CustomControlProvider = new SankeyItemControlProvider(dashboardControl.Dashboard.Items[e.DashboardItemName] as CustomDashboardItem<SankeyItemMetadata>);
}

winforms-dashboard-custom-properties/CS/WinForms-Dashboard-Custom-Properties/Modules/GridFixedColumnModule.cs#L40

csharp
if(e.GridControl != null) {
    GridDashboardItem gridItem = designer.Dashboard.Items[e.DashboardItemName] as GridDashboardItem;
    gridItem.GridOptions.ColumnWidthMode = GridColumnWidthMode.AutoFitToContents;

winforms-dashboard-create-layout-from-scratch/CS/Dashboard_LayoutCustomization/Form1.cs#L30

csharp
// Create layout items for the DateFilter and Chart dashboard items.
DashboardLayoutItem dateFilterLayoutItem = new DashboardLayoutItem(dashboard.Items["dateFilterDashboardItem1"], 13);
DashboardLayoutItem chartLayoutItem = new DashboardLayoutItem(dashboard.Items["chartDashboardItem1"], 87);

winforms-dashboard-apply-conditional-formatting-to-grid-cells/VB/Dashboard_ConditionalFormatting_Grid/BarConditionForm.vb#L13

vb
dashboardViewer1.Dashboard = dashboard
Dim grid As GridDashboardItem = CType(dashboard.Items("gridDashboardItem1"), GridDashboardItem)
Dim extendedPrice As GridMeasureColumn = CType(grid.Columns(1), GridMeasureColumn)

wpf-dashboard-custom-properties/VB/Wpf-Dashboard-Custom-Properties/Modules/ChartItemModule/ChartOptions/ScaleBreak.vb#L17

vb
Dim provider As IDashboardControlProvider = CType(values(1), IDashboardControlProvider)
Dim chartItem As ChartDashboardItem = TryCast(provider.Dashboard.Items(itemName), ChartDashboardItem)
Dim scaleBreakEnabled As Boolean = System.Convert.ToBoolean(chartItem.CustomProperties(ChartItemModule.ScaleBreakPropertyName))

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

vb
If e.MetadataType Is GetType(TreeListItemMetadata) Then
    e.CustomControlProvider = New TreeListItemControlProvider(TryCast(dashboardControl.Dashboard.Items(e.DashboardItemName), CustomDashboardItem(Of TreeListItemMetadata)))
End If

winforms-dashboard-custom-properties/VB/WinForms-Dashboard-Custom-Properties/Modules/GridFixedColumnModule.vb#L40

vb
If e.GridControl IsNot Nothing Then
    Dim gridItem As GridDashboardItem = TryCast(designer.Dashboard.Items(e.DashboardItemName), GridDashboardItem)
    gridItem.GridOptions.ColumnWidthMode = GridColumnWidthMode.AutoFitToContents

winforms-dashboard-create-layout-from-scratch/VB/Dashboard_LayoutCustomization/Form1.vb#L28

vb
' Create layout items for the DateFilter and Chart dashboard items.
Dim dateFilterLayoutItem As New DashboardLayoutItem(dashboard.Items("dateFilterDashboardItem1"), 13)
Dim chartLayoutItem As New DashboardLayoutItem(dashboard.Items("chartDashboardItem1"), 87)

See Also

Dashboard Class

Dashboard Members

DevExpress.DashboardCommon Namespace