Skip to main content
All docs
V25.1
  • ExcelDataSource.FillAsync() Method

    Populates the ExcelDataSource in an asynchronous manner.

    Namespace: DevExpress.DataAccess.Excel

    Assembly: DevExpress.DataAccess.v25.1.dll

    NuGet Package: DevExpress.DataAccess

    Declaration

    public Task FillAsync()

    Returns

    Type Description
    Task

    A task that populates the data source.

    Remarks

    Use this method to populate an Excel data source in an individual task asynchronously. Unlike the Fill() method call, FillAsync does not lock other actions performed concurrently. For instance, the user interface remains operational while the data source is populated.

    Call the FillAsync method with the await operator.

    Example

    The code sample below creates an ExcelDataSource and populates it in an asynchronous manner.

    using DevExpress.DataAccess.Excel;
    using DevExpress.XtraReports.UI;
    using System.Threading;
    XtraReport report = new XtraReport();
    // Creates and configures the Excel data source.
    ExcelDataSource excelDataSource = new ExcelDataSource();
    excelDataSource.Name = "Excel Data Source";
    excelDataSource.FileName = "Sales.xlsx";
    ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("SalesPerson", "A1:L2000");
    excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
    // Populates the data source.
    await excelDataSource.FillAsync();
    report.DataSource = excelDataSource;
    

    The following code snippets (auto-collected from DevExpress Examples) contain references to the FillAsync() 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