officefileapi-devexpress-dot-spreadsheet-dot-worksheetdatabindingcollection-dot-bindtodatasource-x28-system-dot-object-devexpress-dot-spreadsheet-dot-cellrange-devexpress-dot-spreadsheet-dot-externaldatasourceoptions-x29.md
Binds the worksheet cell range to the specified data source using the specified options.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
WorksheetDataBinding BindToDataSource(
object dataSource,
CellRange range,
ExternalDataSourceOptions options
)
Function BindToDataSource(
dataSource As Object,
range As CellRange,
options As ExternalDataSourceOptions
) As WorksheetDataBinding
| Name | Type | Description |
|---|---|---|
| dataSource | Object |
A data source object whose data should be retrieved into the worksheet.
| | range | CellRange |
A CellRange object specifying the cell range in which the retrieved data will be inserted.
| | options | ExternalDataSourceOptions |
An ExternalDataSourceOptions object that contains options used to establish binding.
|
| Type | Description |
|---|---|
| WorksheetDataBinding |
A WorksheetDataBinding object that contains information about the data-bound range.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the BindToDataSource(Object, CellRange, ExternalDataSourceOptions) method.
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.
// Bind the data source to the worksheet range.
WorksheetDataBinding sheetDataBinding = sheet.DataBindings.BindToDataSource(weatherDatasource, bindingRange, dsOptions);
spreadsheet-document-api-data-binding/CS/SpreadsheetApiDataBinding/Program.cs#L53
// Bind the data source to the worksheet range.
WorksheetDataBinding sheetDataBinding = worksheet.DataBindings.BindToDataSource(weatherDatasource, bindingRange, dsOptions);
' Bind the data source to the worksheet range.
Dim sheetDataBinding As WorksheetDataBinding = sheet.DataBindings.BindToDataSource(weatherDatasource, bindingRange, dsOptions)
spreadsheet-document-api-data-binding/VB/SpreadsheetApiDataBinding/Program.vb#L47
' Bind the data source to the worksheet range.
Dim sheetDataBinding As WorksheetDataBinding = worksheet.DataBindings.BindToDataSource(weatherDatasource, bindingRange, dsOptions)
See Also
Data Binding in WinForms Spreadsheet Control
WorksheetDataBindingCollection Interface