Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RangeDataSourceOptions Class

Contains various options for a data source created from a cell range.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public class RangeDataSourceOptions :
    DataSourceOptionsBase

#Remarks

A RangeDataSourceOptions object is created and passed as a parameter to the CellRange.GetDataSource or the WorksheetDataBindingCollection.CreateDataSource methods.

#Example

View Example

RangeDataSourceOptions options = new RangeDataSourceOptions();
Worksheet sheet = spreadsheetControl1.ActiveWorksheet;
CellRange 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;

#Inheritance

Object
DataSourceOptionsBase
RangeDataSourceOptions
See Also