Back to Devexpress

ExcelSourceOptions.ImportSettings Property

corelibraries-devexpress-dot-dataaccess-dot-excel-dot-excelsourceoptions.md

latest6.5 KB
Original Source

ExcelSourceOptions.ImportSettings Property

Gets or sets settings used to import data from the Microsoft Excel workbook.

Namespace : DevExpress.DataAccess.Excel

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
[DefaultValue(null)]
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public ExcelSettingsBase ImportSettings { get; set; }
vb
<DefaultValue(Nothing)>
<LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)>
Public Property ImportSettings As ExcelSettingsBase

Property Value

TypeDefaultDescription
ExcelSettingsBasenull

A ExcelSettingsBase descendant containing settings used to import data from the Microsoft Excel workbook.

|

Remarks

The ImportSettings property exposed by the ExcelSourceOptions class allows you to specify the approach used to import data from a workbook. For instance, you can select all data from the specified worksheet or specify the required cell range. To import data from the workbook, create the required ExcelSettingsBase object descendant and specify its settings.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ImportSettings property.

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.

asp-net-mvc-grid-upload-excel-file-using-upload-control-and-display-data-in-grid/CS/T449148/Models/Model.cs#L30

csharp
ExcelSourceOptions excelSourceOptions = new ExcelSourceOptions();
excelSourceOptions.ImportSettings = excelWorksheetSettings;
excelSourceOptions.SkipHiddenRows = false;

data-access-library-create-data-sources-at-runtime/CS/ExcelDataSourceSnippets/Code.cs#L37

csharp
ExcelSourceOptions excelSourceOptions = new ExcelSourceOptions();
excelSourceOptions.ImportSettings = excelWorksheetSettings;
excelSourceOptions.SkipHiddenRows = false;

asp-net-mvc-grid-upload-excel-file-using-upload-control-and-display-data-in-grid/VB/T449148_VB/Models/Model.vb#L15

vb
Dim excelSourceOptions As ExcelSourceOptions = New ExcelSourceOptions()
excelSourceOptions.ImportSettings = excelWorksheetSettings
excelSourceOptions.SkipHiddenRows = False

reporting-winforms-bind-excel-runtime/VB/BindingReportToExcelWorkbook/Form1.vb#L28

vb
Dim excelSourceOptions As ExcelSourceOptions = New ExcelSourceOptions()
excelSourceOptions.ImportSettings = excelWorksheetSettings
excelSourceOptions.SkipHiddenRows = False

winforms-dashboard-bind-pie-item-to-data-in-code/VB/Dashboard_CreatePies/Form1.vb#L27

vb
importSettings.CellRange = "A1:L100"
options.ImportSettings = importSettings
excelDataSource.SourceOptions = options

data-access-library-create-data-sources-at-runtime/VB/ExcelDataSourceSnippets/Code.vb#L35

vb
Dim excelSourceOptions As New ExcelSourceOptions()
excelSourceOptions.ImportSettings = excelWorksheetSettings
excelSourceOptions.SkipHiddenRows = False

See Also

ExcelSourceOptions Class

ExcelSourceOptions Members

DevExpress.DataAccess.Excel Namespace