[]
        
(Showing Draft Content)

C1.WPF.Grid.Extensions.LoadExcelAsync

LoadExcelAsync Method

LoadExcelAsync(FlexGrid, string)

Loads data from an Excel file into the specified grid asynchronously.

Declaration
public static Task LoadExcelAsync(this FlexGrid grid, string fileName)
Parameters
Type Name Description
FlexGrid grid

Instance of the FlexGrid to load the data into.

string fileName

The path to the Excel file.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Examples
var grid = new FlexGrid();
await grid.LoadExcel("ExcelFileSample.xlsx");
Exceptions
Type Condition
ArgumentException
ArgumentNullException
PathTooLongException
DirectoryNotFoundException
UnauthorizedAccessException
FileNotFoundException
NotSupportedException
IOException
ArgumentOutOfRangeException

LoadExcelAsync(FlexGrid, string, string)

Loads data from an Excel file into the specified grid asynchronously.

Declaration
public static Task LoadExcelAsync(this FlexGrid grid, string fileName, string sheetName)
Parameters
Type Name Description
FlexGrid grid

Instance of the FlexGrid to load the data into.

string fileName

The path to the Excel file.

string sheetName

The name of the Excel sheet to load. If null, the first sheet will be loaded by default.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Exceptions
Type Condition
ArgumentException
ArgumentNullException
PathTooLongException
DirectoryNotFoundException
UnauthorizedAccessException
FileNotFoundException
NotSupportedException
IOException
ArgumentOutOfRangeException

LoadExcelAsync(FlexGrid, string, LoadExcelOptions)

Loads data from an Excel file into the specified grid asynchronously.

Declaration
public static Task LoadExcelAsync(this FlexGrid grid, string fileName, LoadExcelOptions options)
Parameters
Type Name Description
FlexGrid grid

Instance of the FlexGrid to load the data into.

string fileName

The path to the Excel file.

LoadExcelOptions options

A LoadExcelOptions loading options.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Exceptions
Type Condition
ArgumentException
ArgumentNullException
PathTooLongException
DirectoryNotFoundException
UnauthorizedAccessException
FileNotFoundException
NotSupportedException
IOException
ArgumentOutOfRangeException

LoadExcelAsync(FlexGrid, string, string, LoadExcelOptions)

Loads data from an Excel file into the specified grid asynchronously.

Declaration
public static Task LoadExcelAsync(this FlexGrid grid, string fileName, string sheetName, LoadExcelOptions options)
Parameters
Type Name Description
FlexGrid grid

Instance of the FlexGrid to load the data into.

string fileName

The path to the Excel file.

string sheetName

The name of the Excel sheet to load. If null, the first sheet will be loaded by default.

LoadExcelOptions options

A LoadExcelOptions loading options.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Exceptions
Type Condition
ArgumentException
ArgumentNullException
PathTooLongException
DirectoryNotFoundException
UnauthorizedAccessException
FileNotFoundException
NotSupportedException
IOException
ArgumentOutOfRangeException

LoadExcelAsync(FlexGrid, string, ExcelFileFormat, string, LoadExcelOptions, CancellationToken)

Loads data from an Excel file into the specified grid asynchronously.

Declaration
public static Task LoadExcelAsync(this FlexGrid grid, string fileName, ExcelFileFormat fileFormat, string sheetName, LoadExcelOptions options, CancellationToken cancellationToken)
Parameters
Type Name Description
FlexGrid grid

Instance of the FlexGrid to load the data into.

string fileName

The path to the Excel file.

ExcelFileFormat fileFormat

A ExcelFileFormat file format.

string sheetName

The name of the Excel sheet to load. If null, the first sheet will be loaded by default.

LoadExcelOptions options

A LoadExcelOptions loading options.

CancellationToken cancellationToken

The token to monitor for cancellation requests.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Exceptions
Type Condition
ArgumentException
ArgumentNullException
PathTooLongException
DirectoryNotFoundException
UnauthorizedAccessException
FileNotFoundException
NotSupportedException
IOException
ArgumentOutOfRangeException
OperationCanceledException