dashboard-devexpress-dot-dashboardcommon-dot-dashboard-649e5c39.md
Gets the collection of dashboard items.
Namespace : DevExpress.DashboardCommon
Assembly : DevExpress.Dashboard.v25.2.Core.dll
NuGet Package : DevExpress.Dashboard.Core
public DashboardItemCollection Items { get; }
Public ReadOnly Property Items As DashboardItemCollection
| Type | Description |
|---|---|
| DashboardItemCollection |
A collection of DashboardItem descendants. Contains dashboard items displayed within this dashboard.
|
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.
dashboardViewer1.Dashboard = dashboard;
GridDashboardItem grid = (GridDashboardItem)dashboard.Items["gridDashboardItem1"];
GridMeasureColumn extendedPrice = (GridMeasureColumn)grid.Columns[1];
IDashboardControlProvider provider = (IDashboardControlProvider)values[1];
ChartDashboardItem chartItem = provider.Dashboard.Items[itemName] as ChartDashboardItem;
bool scaleBreakEnabled = System.Convert.ToBoolean(chartItem.CustomProperties[ChartItemModule.ScaleBreakPropertyName]);
if(e.MetadataType == typeof(SankeyItemMetadata))
e.CustomControlProvider = new SankeyItemControlProvider(dashboardControl.Dashboard.Items[e.DashboardItemName] as CustomDashboardItem<SankeyItemMetadata>);
}
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
// 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);
dashboardViewer1.Dashboard = dashboard
Dim grid As GridDashboardItem = CType(dashboard.Items("gridDashboardItem1"), GridDashboardItem)
Dim extendedPrice As GridMeasureColumn = CType(grid.Columns(1), GridMeasureColumn)
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))
If e.MetadataType Is GetType(TreeListItemMetadata) Then
e.CustomControlProvider = New TreeListItemControlProvider(TryCast(dashboardControl.Dashboard.Items(e.DashboardItemName), CustomDashboardItem(Of TreeListItemMetadata)))
End If
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
' 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