Skip to main content
All docs
V22.1

DashboardObjectDataSource.DataId Property

Gets or sets the unique identifier of an Object data source.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v22.1.Core.dll

Declaration

[DefaultValue(null)]
public string DataId { get; set; }

Property Value

Type Default Description
String

null

An Object data source’s identifier.

Remarks

Use the DataId property to identify the data source for which the DataLoading event is raised.

This example shows how to bind the ASP.NET MVC Dashboard extension to the Object Data Source and use the DashboardConfigurator.DataLoading event to supply the data source with data:

using System.Web.Routing;
using DevExpress.DashboardWeb;
using DevExpress.DashboardWeb.Mvc;
using DevExpress.DashboardCommon;

namespace DashboardMVC {
    public static class DashboardConfig {
        public static void RegisterService(RouteCollection routes) {
            routes.MapDashboardRoute("dashboardControl");

            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
            DashboardConfigurator.Default.SetDashboardStorage(dashboardFileStorage);
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
             // Registers an Object data source.
            DashboardObjectDataSource objDataSource = new DashboardObjectDataSource("Object Data Source");
            objDataSource.DataId = "Object Data Source ID";
            dataSourceStorage.RegisterDataSource("objDataSource", objDataSource.SaveToXml());
            DashboardConfigurator.Default.SetDataSourceStorage(dataSourceStorage);
            DashboardConfigurator.Default.DataLoading += DataLoading;
        }
         private static void DataLoading(object sender, DataLoadingWebEventArgs e) {
            if(e.DataId == "Object Data Source ID") {
                e.Data = Invoices.CreateData();
            }
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataId 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.

See Also