Back to Devexpress

DataLoadingEventArgs.DataSourceName Property

dashboard-devexpress-dot-dashboardcommon-dot-dataloadingeventargs-dc380830.md

latest5.2 KB
Original Source

DataLoadingEventArgs.DataSourceName Property

Gets the name of the data source for which the event has been raised.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public string DataSourceName { get; }
vb
Public ReadOnly Property DataSourceName As String

Property Value

TypeDescription
String

A String that is the name of the data source for which the event has been raised.

|

Remarks

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

To provide data, use the DataLoadingEventArgs.Data property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSourceName 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-bind-a-dashboard-to-a-list-object/CS/Dashboard_BindingToList/Form1.cs#L20

csharp
dashboardViewer1.DataLoading += (s, ev) => {
    if (ev.DataSourceName == "Data Source 1")
        ev.Data = Data.CreateData();

winforms-dashboard-bind-a-dashboard-to-a-dataset-populated-from-an-xml-file/CS/Dashboard_DataLoading_Example/Form1.cs#L20

csharp
private void DashboardViewer1_DataLoading(object sender, DataLoadingEventArgs e) {
    if (e.DataSourceName == "EnergyConsumptionBySector") {
        e.Data = GetData(dataFileName);

asp-net-core-dashboard-export-all-items/CS/AspNetCoreDashboard_ExportAllItems/Startup.cs#L66

csharp
configurator.DataLoading += (s, e) => {
    if(e.DataSourceName == "Object Data Source") {
        e.Data = Invoices.CreateData();

wpf-dashboard-how-to-bind-to-object-list/CS/WpfDashboard_ObjectDataSource/MainWindow.xaml.cs#L23

csharp
{
    if (e.DataSourceName == "MyDataSource")
        e.Data = Data.CreateData();

winforms-dashboard-designer-bind-a-dashboard-to-a-list-object/VB/Dashboard_BindingToList/Form1.vb#L22

vb
AddHandler dashboardViewer1.DataLoading, Sub(s, ev)
    If ev.DataSourceName = "Data Source 1" Then
        ev.Data = Data.CreateData()

winforms-dashboard-bind-a-dashboard-to-a-dataset-populated-from-an-xml-file/VB/Dashboard_DataLoading_Example/Form1.vb#L20

vb
Private Sub DashboardViewer1_DataLoading(ByVal sender As Object, ByVal e As DataLoadingEventArgs)
    If e.DataSourceName = "EnergyConsumptionBySector" Then
        e.Data = GetData(dataFileName)

wpf-dashboard-how-to-bind-to-object-list/VB/WpfDashboard_ObjectDataSource/MainWindow.xaml.vb#L22

vb
Private Sub dashboardControl_AsyncDataLoading(ByVal sender As Object, ByVal e As DataLoadingEventArgs)
    If Equals(e.DataSourceName, "MyDataSource") Then e.Data = Data.CreateData()
End Sub

See Also

DataLoadingEventArgs Class

DataLoadingEventArgs Members

DevExpress.DashboardCommon Namespace