RangeDataSourceOptions Class
Contains various options for a data source created from a cell range.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v17.2.Core.dll
Declaration
Remarks
A RangeDataSourceOptions object is created and passed as a parameter to the Range.GetDataSource or the WorksheetDataBindingCollection.CreateDataSource methods.
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/an-example-of-using-a-cell-range-as-a-data-source-t483776
RangeDataSourceOptions options = new RangeDataSourceOptions();
Worksheet sheet = spreadsheetControl1.ActiveWorksheet;
Range dataRange = sheet.Selection;
if (dataRange.Equals(sheet.Tables[0].Range))
options.UseFirstRowAsHeader = true;
else {
options.UseFirstRowAsHeader = false;
options.DataSourceColumnTypeDetector = new MyColumnDetector();
}
options.SkipHiddenColumns = true;
rangeDS = dataRange.GetDataSource(options);
sheet.DataBindings.Error += DataBindings_Error;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the RangeDataSourceOptions class.
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.