The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

ExternalDataSourceOptions Class

Contains options for data retrieval from an external data source when establishing a data binding.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

public class ExternalDataSourceOptions : DataSourceOptionsBase
Public Class ExternalDataSourceOptions
    Inherits DataSourceOptionsBase
public class ExternalDataSourceOptions : DataSourceOptionsBase
Public Class ExternalDataSourceOptions
    Inherits DataSourceOptionsBase

Remarks

An ExternalDataSourceOptions class instance is assigned as a parameter to the WorksheetDataBindingCollection.BindToDataSource method.

Examples

private void BindWeatherReportToRange(object weatherDatasource, Range bindingRange) {
    Worksheet sheet = spreadsheetControl1.Document.Worksheets[0];

    // Check for range conflicts.
    var dataBindingConflicts = sheet.DataBindings.
        Where(d => (d.Range.RightColumnIndex >= bindingRange.LeftColumnIndex) || (d.Range.BottomRowIndex >= bindingRange.TopRowIndex)) ;
    if (dataBindingConflicts.Count() > 0) {
        MessageBox.Show("Cannot bind the range to data.\r\nThe worksheet contains other binding ranges which may conflict.", "Range Conflict");
        return;
    }

    // Specify the binding options.
    ExternalDataSourceOptions dsOptions = new ExternalDataSourceOptions();
    dsOptions.ImportHeaders = true;
    dsOptions.CellValueConverter = new MyWeatherConverter();
    dsOptions.SkipHiddenRows = true;

    // Bind the data source to the worksheet range.
    WorksheetDataBinding sheetDataBinding = sheet.DataBindings.BindToDataSource(weatherDatasource, bindingRange, dsOptions);

    // Adjust the column width.
    sheetDataBinding.Range.AutoFitColumns();
}

Inheritance

Object
DataSourceOptionsBase
ExternalDataSourceOptions
See Also