Back to Devexpress

DashboardDesigner.AsyncDataLoading Event

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-931ca155.md

latest5.4 KB
Original Source

DashboardDesigner.AsyncDataLoading Event

Allows you to provide data for the DashboardObjectDataSource in asynchronous mode.

Namespace : DevExpress.DashboardWin

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

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public event DataLoadingEventHandler AsyncDataLoading
vb
Public Event AsyncDataLoading As DataLoadingEventHandler

Event Data

The AsyncDataLoading event's data class is DataLoadingEventArgs. The following properties provide information specific to this event:

PropertyDescription
DataGets or sets data for the current data source.
DataIdGets an object data source’s unique identifier.
DataSourceComponentNameGet the component name of the data source for which the event has been raised.
DataSourceNameGets the name of the data source for which the event has been raised.
OverwriteDataSourcePropertySpecifies whether the DataSource and DataMember properties of the DashboardObjectDataSource are set when data is supplied in the event handler.
ParametersProvides access to parameter values passed to the object data source.

Remarks

The AsyncDataLoading event is raised in asynchronous mode when the dashboard loads data from the DashboardObjectDataSource. Use the event parameter’s e.Data property to provide data for this data source. The data object should implement the IEnumerable or IListSource interface.

Important

The DashboardDesigner.AsyncDataLoading and DashboardDesigner.DataLoading events in asynchronous mode may occur multiple times while you design a dashboard and change the dashboard object model. To improve performance, do not call time-consuming methods in the event handler.

For an example of use, review the Dashboard Designer in Asynchronous Mode with Object Data Source project that is available in the DevExpress Examples repository.

Note

You cannot access a control’s properties such as the DashboardControl.Dashboard property through the AsyncDataLoading event because it receives data asynchronously from a background thread.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AsyncDataLoading event.

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-async-mode-designer-data-loading/CS/DashboardDesignerAsyncModeExample/Form1.cs#L16

csharp
dashboardDesigner1.DataLoading += DashboardDesigner1_DataLoading;
dashboardDesigner1.AsyncDataLoading += DashboardDesigner1_AsyncDataLoading;
Task.Run(async () => await LoadData());

winforms-dashboard-async-mode-designer-data-loading/VB/DashboardDesignerAsyncModeExample/Form1.vb#L15

vb
AddHandler dashboardDesigner1.DataLoading, AddressOf DashboardDesigner1_DataLoading
AddHandler dashboardDesigner1.AsyncDataLoading, AddressOf DashboardDesigner1_AsyncDataLoading
Task.Run(Async Function()

Implements

AsyncDataLoading

See Also

Asynchronous Mode

DashboardDesigner Class

DashboardDesigner Members

DevExpress.DashboardWin Namespace