dashboard-devexpress-dot-dashboardcommon-dot-dashboard-124f4ca2.md
Gets the collection of dashboard data sources.
Namespace : DevExpress.DashboardCommon
Assembly : DevExpress.Dashboard.v25.2.Core.dll
NuGet Package : DevExpress.Dashboard.Core
public DataSourceCollection DataSources { get; }
Public ReadOnly Property DataSources As DataSourceCollection
| Type | Description |
|---|---|
| DataSourceCollection |
A collection of objects implementing the IDashboardDataSource interface.
|
The DataSources property provides access to the collection of the dashboard data sources. See Supported Data Sources for information about what types of data sources you can add to the DataSources collection. Use the data source’s ComponentName property to find the data source in DataSourceCollection.
All data-aware dashboard items expose the DataDashboardItem.DataSource property that allows you to specify the required data source for the dashboard item. If you are using the DashboardSqlDataSource and DashboardEFDataSource, set the DataDashboardItem.DataMember property to specify a required data member in a dashboard data source. For instance, for a DashboardSqlDataSource data source, the data member is the name of the query (the SqlQuery.Name property).
When a data source is added or removed from the DataSources collection, the Dashboard.DataSourceCollectionChanged event is fired.
The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSources 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/DataSourceMerger.cs#L10
public static void MergeDataSources(DataSourceCollection fromDataSources, DashboardMerger dashboardMerger) {
DataSourceCollection toDataSources = dashboardMerger.TargetDashboard.DataSources;
PieDashboardItem pies = new PieDashboardItem();
pies.DataSource = dashboard.DataSources[0];
Dimension salesPersonArgument = new Dimension("SalesPerson");
pivot.DataMember = "Orders";
pivot.DataSource = dashboard.DataSources[0];
pivot.Rows.AddRange(new Dimension("ShipCountry"), new Dimension("ShipCity"));
wpf-dashboard-how-to-bind-to-object-list/CS/WpfDashboard_ObjectDataSource/MainWindow.xaml.cs#L37
PieDashboardItem pies = new PieDashboardItem();
pies.DataSource = dashboard.DataSources[0];
Dimension salesPersonArgument = new Dimension("SalesPerson");
winforms-dashboard-customize-color-scheme/CS/Dashboard_Coloring/Form1.cs#L16
Dashboard dashboard = new Dashboard(); dashboard.LoadFromXml(@"..\..\Data\Dashboard.xml");
IDashboardDataSource dataSource = dashboard.DataSources["dataSource1"];
winforms-dashboard-designer-merge-dashboards-to-tabs/VB/DashboardMerger/DataSourceMerger.vb#L14
Public Shared Sub MergeDataSources(ByVal fromDataSources As DataSourceCollection, ByVal dashboardMerger As DashboardMerger)
Dim toDataSources As DataSourceCollection = dashboardMerger.TargetDashboard.DataSources
Dim pies As New PieDashboardItem()
pies.DataSource = dashboard.DataSources(0)
Dim salesPersonArgument As New Dimension("SalesPerson")
pivot.DataMember = "Orders"
pivot.DataSource = dashboard.DataSources(0)
pivot.Rows.AddRange(New Dimension("ShipCountry"), New Dimension("ShipCity"))
wpf-dashboard-how-to-bind-to-object-list/VB/WpfDashboard_ObjectDataSource/MainWindow.xaml.vb#L33
Dim pies As PieDashboardItem = New PieDashboardItem()
pies.DataSource = dashboard.DataSources(0)
Dim salesPersonArgument As Dimension = New Dimension("SalesPerson")
winforms-dashboard-customize-color-scheme/VB/Dashboard_Coloring/Form1.vb#L19
dashboard.LoadFromXml("..\..\Data\Dashboard.xml")
Dim dataSource As IDashboardDataSource = dashboard.DataSources("dataSource1")
See Also