Skip to content

DevExpress-Examples/wpf-dashboard-how-to-bind-to-object-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BI Dashboard for WPF - How to Bind a Dashboard to a List<Data> Object

The example shows how to bind a dashboard to a System.Collections.Generic.List<Data> object.

This example creates a dashboard at runtime and assigns it to the DashboardControl.DashboardSource property in the Window_Loaded event handler. The dashboard adds the DashboardObjectDataSource object to its DataSources collection and uses it as the data source for dashboard items.

The DashboardObjectDataSource gets its data in the DashboardControl.AsyncDataLoading event. The collection of objects is assigned to the e.Data property.

A data source in the Dashboard.DataSources collection is determined by its name. The name is assigned in the DashboardObjectDataSource constructor.

C#

private void dashboardControl_AsyncDataLoading(object sender, DataLoadingEventArgs e)
{
    if (e.DataSourceName == "MyDataSource")
        e.Data = Data.CreateData();
}

Visual Basic

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

The DashboardControl.ReloadData method refreshes the data.

A dialog with a warning message is displayed before loading an object data source. This dialog is the security measure that allows end-users to prevent code execution in the object data sources. For more information, refer to the following document: Security Considerations.

If you trust the application's data sources, set the DashboardControl.ObjectDataSourceLoadingBehavior property to LoadAsIs to suppress the warning.

Files to Review

Documentation

More Examples

Dashboard for WPF - How to bind a dashboard to an OLAP cube