Back to Devexpress

DashboardViewer.AsyncDataLoading Event

dashboard-devexpress-dot-dashboardwin-dot-dashboardviewer-c2f45983.md

latest5.8 KB
Original Source

DashboardViewer.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.

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 snippets (auto-collected from DevExpress Examples) contain references 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-apply-conditional-formatting-to-grid-cells/CS/Dashboard_ConditionalFormatting_Grid/DateOccurringForm.cs#L8

csharp
InitializeComponent();
dashboardViewer1.AsyncDataLoading += OnDashboardViewerAsyncDataLoading;
dashboardViewer1.DataSourceOptions.ObjectDataSourceLoadingBehavior = DevExpress.DataAccess.DocumentLoadingBehavior.LoadAsIs;

winviewer-how-to-create-custom-card-layout-template/CS/ViewerForm.cs#L22

csharp
DashboardObjectDataSource dataSource = new DashboardObjectDataSource();
dashboardViewer1.AsyncDataLoading += (s, ev) => {
    ev.Data = DataGenerator.GenerateTestData();

winforms-dashboard-apply-conditional-formatting-to-grid-cells/VB/Dashboard_ConditionalFormatting_Grid/DateOccurringForm.vb#L11

vb
InitializeComponent()
AddHandler dashboardViewer1.AsyncDataLoading, AddressOf OnDashboardViewerAsyncDataLoading
dashboardViewer1.DataSourceOptions.ObjectDataSourceLoadingBehavior = DevExpress.DataAccess.DocumentLoadingBehavior.LoadAsIs

winviewer-how-to-create-custom-card-layout-template/VB/ViewerForm.vb#L18

vb
Dim dataSource As New DashboardObjectDataSource()
AddHandler dashboardViewer1.AsyncDataLoading, Sub(s, ev)
                                                  ev.Data = DataGenerator.GenerateTestData()

Implements

AsyncDataLoading

See Also

Asynchronous Mode

DashboardViewer Class

DashboardViewer Members

DevExpress.DashboardWin Namespace