Skip to main content
All docs
V25.1
  • DashboardViewer.UpdateExtractDataSourcesAsync(Action<String, ExtractUpdateResult>, Action<String, ExtractUpdateResult>) Method

    Updates all extract data sources in the current dashboard asynchronously. Allows you to specify custom actions to perform after updating the data and file.

    Namespace: DevExpress.DashboardWin

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

    NuGet Package: DevExpress.Win.Dashboard

    Declaration

    public Task UpdateExtractDataSourcesAsync(
        Action<string, ExtractUpdateResult> onDataUpdated,
        Action<string, ExtractUpdateResult> onFileUpdated
    )

    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.

    Returns

    Type Description
    Task

    The task object that is the asynchronous operation to complete.

    Example

    View Example: WinForms - Dashboard with Extract Data Source

    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.

    delegate void SafeUpdate(string file);
    
    private async void UpdateExtractAsync() {
        await dashboardViewer1.UpdateExtractDataSourcesAsync(
            (fileName, result) => { 
                OnDataReady(fileName); 
            },
            (fileName, result) => { 
                MessageBox.Show($"File {fileName} updated "); 
            });
    }
    
    void OnDataReady(string fileName) {
        dashboardViewer1.Invoke(new SafeUpdate(UpdateViewer), new object[] { fileName });
    }
    void UpdateViewer(string fileName) {
        MessageBox.Show($"Data for the file {fileName} is ready ");
        dashboardViewer1.ReloadData();
    }
    

    The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UpdateExtractDataSourcesAsync(Action<String, ExtractUpdateResult>, Action<String, ExtractUpdateResult>) method.

    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.

    See Also