corelibraries-devexpress-dot-dataaccess-dot-excel-dot-exceldatasource-d3902a10.md
Gets or sets options used to extract data from Microsoft Excel workbooks (XLS, XLSX or XLSM files) or CSV files.
Namespace : DevExpress.DataAccess.Excel
Assembly : DevExpress.DataAccess.v25.2.dll
NuGet Package : DevExpress.DataAccess
[DefaultValue(null)]
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public ExcelSourceOptionsBase SourceOptions { get; set; }
<DefaultValue(Nothing)>
<LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)>
Public Property SourceOptions As ExcelSourceOptionsBase
| Type | Default | Description |
|---|---|---|
| ExcelSourceOptionsBase | null |
A ExcelSourceOptionsBase descendant containing options used to extract data from Microsoft Excel workbooks (XLS, XLSX or XLSM files) or CSV files.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the SourceOptions 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.
data-access-library-create-data-sources-at-runtime/CS/ExcelDataSourceSnippets/Code.cs#L23
csvSourceOptions.DetectValueSeparator = true;
excelDataSource.SourceOptions = csvSourceOptions;
}
winforms-grid-open-excel-files/CS/Form1.cs#L21
var worksheetSettings = new ExcelWorksheetSettings("Sheet1", "A1:B3");
source.SourceOptions = new ExcelSourceOptions(worksheetSettings);
source.Fill();
excelSourceOptions.UseFirstRowAsHeader = true;
excelDataSource.SourceOptions = excelSourceOptions;
reporting-winforms-bind-to-csv-file/CS/BindingReportToCsvFile/Form1.cs#L31
};
excelDataSource.SourceOptions = csvSourceOptions;
winforms-dashboard-grid-hyperlink-column/CS/Dashboard_GridHyperlinkColumn/Form1.cs#L17
excelDataSource.FileName = @"..\..\Data\GDPByCountry.xlsx";
excelDataSource.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("Sheet1"));
dashboard.DataSources.Add(excelDataSource);
data-access-library-create-data-sources-at-runtime/VB/ExcelDataSourceSnippets/Code.vb#L21
csvSourceOptions.DetectValueSeparator = True
excelDataSource.SourceOptions = csvSourceOptions
End Sub
winforms-grid-open-excel-files/VB/Form1.vb#L16
Dim worksheetSettings = New ExcelWorksheetSettings("Sheet1", "A1:B3")
source.SourceOptions = New ExcelSourceOptions(worksheetSettings)
source.Fill()
excelSourceOptions.UseFirstRowAsHeader = True
excelDataSource.SourceOptions = excelSourceOptions
excelDataSource.Fill()
reporting-winforms-bind-to-csv-file/VB/BindingReportToCsvFile/Form1.vb#L23
Dim csvSourceOptions As CsvSourceOptions = New CsvSourceOptions With {.DetectEncoding = True, .DetectNewlineType = True, .DetectValueSeparator = True}
excelDataSource.SourceOptions = csvSourceOptions
' Define the data source schema.
reporting-winforms-bind-excel-runtime/VB/BindingReportToExcelWorkbook/Form1.vb#L31
excelSourceOptions.SkipHiddenColumns = False
excelDataSource.SourceOptions = excelSourceOptions
' Create new fields and specify their settings.
See Also