All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ExcelDataSource.FillAsync() Method

Populates the ExcelDataSource in an asynchronous manner.

Namespace: DevExpress.DataAccess.Excel

Assembly: DevExpress.DataAccess.v20.1.dll

Declaration

public Task FillAsync()
Public Function FillAsync As Task

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 System.Threading;
using System.Threading.Tasks;
using System.IO;
using DevExpress.Utils;
using DevExpress.DataAccess.Excel;
// ...
// Create and configure an Excel data source.
ExcelDataSource excelDataSource = new ExcelDataSource();
excelDataSource.Name = "Excel Data Source";
excelDataSource.FileName = Path.Combine(Path.GetDirectoryName(typeof(ReportCreator).Assembly.Location), "Sales.xlsx");
ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("SalesPerson", "A1:L2000");
excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
// Populate the data source.
await excelDataSource.FillAsync();
report.DataSource = excelDataSource;
See Also