Skip to main content
A newer version of this page is available. .
All docs
V21.2

DataLoadingEventArgs.DataId Property

Gets an object data source’s unique identifier.

Namespace: DevExpress.DashboardCommon

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

NuGet Package: DevExpress.Dashboard.Core

Declaration

public string DataId { get; }

Property Value

Type Description
String

An object data source’s identifier.

Remarks

Use the DataId property to identify the data source for which the 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