Skip to main content
A newer version of this page is available. .

DashboardExtractDataSource.UpdateFile(DashboardExtractDataSource, Action<String, ExtractUpdateResult>, Action<String, ExtractUpdateResult>) Method

Static method to update data in the data extract file. Allows you to prevent access to the file until the data is refreshed and the file is re-created.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.2.Core.dll

NuGet Packages: DevExpress.Dashboard.Core, DevExpress.WindowsDesktop.Dashboard.Core

Declaration

public static void UpdateFile(
    DashboardExtractDataSource dataSource,
    Action<string, ExtractUpdateResult> onDataUpdated,
    Action<string, ExtractUpdateResult> onFileUpdated
)

Parameters

Name Type Description
dataSource DashboardExtractDataSource

A DashboardExtractDataSource instance that is the data source to update.

onDataUpdated Action<String, ExtractUpdateResult>

A Action delegate that specifies the action to perform when the data is updated.

onFileUpdated Action<String, ExtractUpdateResult>

A Action delegate that specifies the action to perform when the file is re-created.

Example

This example demonstrates how to refresh the data contained in the Extract Data Source in web application.

View Example: How to use DashboardExtractDataSource in the ASPxDashboard control

To update the data extract file, an AJAX request is sent to the server and calls the server-side DashboardExtractDataSource.UpdateFile method. When the data is updated and a new extract file is created on the server, the callback returns to the client and calls the ASPxClientDashboard.Refresh method to load new data:

function UpdateExtractDataSource() {
    $.ajax({
        url: "Default.aspx/UpdateExtractDataSource",
        type: "POST",
        data: {},
        contentType: "application/json; charset=utf-8"
    }).done(function (result) {
        dashboard.ReloadData();
    });
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UpdateFile(DashboardExtractDataSource, 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