DashboardControl.UpdateExtractDataSourcesAsync(Action<String, ExtractUpdateResult>, Action<String, ExtractUpdateResult>, String[]) Method
Updates the specified extract data sources in the current dashboard asynchronously. Allows you to specify custom actions to perform after updating the data and file.
Namespace: DevExpress.DashboardWpf
Assembly: DevExpress.Dashboard.v20.2.Wpf.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Dashboard, DevExpress.Wpf.Dashboard
Declaration
public void UpdateExtractDataSourcesAsync(
Action<string, ExtractUpdateResult> onDataUpdated,
Action<string, ExtractUpdateResult> onFileUpdated,
params string[] dataSourceNames
)
Parameters
Name | Type | Description |
---|---|---|
onDataUpdated | Action<String, ExtractUpdateResult> | A custom action to perform when the data is updated. |
onFileUpdated | Action<String, ExtractUpdateResult> | A custom action to perform when the file is updated. |
dataSourceNames | String[] | A list of the data source names. |
Example
The following code snippet implements the UpdateExtractAsync method that updates all extract files bound to the dashboard. It displays a message box and reloads DashboardViewer’s data when data is updated, and displays a message box when the extract files are updated.
<dx:ThemedWindow x:Class="UpdateExtractDataSourceExample.MainWindow"
mc:Ignorable="d" Title="Update ExtractDataSource" Height="500" Width="800"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dashboard="clr-namespace:DevExpress.DashboardWpf;assembly=DevExpress.Dashboard.v19.2.Wpf">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="49*" />
<RowDefinition Height="520*" />
</Grid.RowDefinitions>
<dashboard:DashboardControl x:Name="dashboardControl1" Grid.Row="1" />
<dx:SimpleButton Content="Click to update extract data file"
HorizontalAlignment="Left" Margin="24,5,0,0" Grid.Row="0"
VerticalAlignment="Top" Width="215" Click="Button_Click" Height="29" />
</Grid>
</dx:ThemedWindow>