officefileapi-devexpress-dot-spreadsheet-dot-worksheetdatabindingcollection-dot-bindtodatasource-x28-system-dot-object-system-dot-int32-system-dot-int32-x29.md
Binds the worksheet cell range to the specified data source.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
WorksheetDataBinding BindToDataSource(
object dataSource,
int rowIndex,
int columnIndex
)
Function BindToDataSource(
dataSource As Object,
rowIndex As Integer,
columnIndex As Integer
) As WorksheetDataBinding
| Name | Type | Description |
|---|---|---|
| dataSource | Object |
A data source object whose data should be retrieved into the worksheet.
| | rowIndex | Int32 |
An integer that is the row index of the top left cell in the binding range.
| | columnIndex | Int32 |
An integer that is the column index of the top left cell in the binding range.
|
| Type | Description |
|---|---|
| WorksheetDataBinding |
A WorksheetDataBinding object that contains information about the data-bound range.
|
The method uses default values of the ExternalDataSourceOptions object.
The following code snippets (auto-collected from DevExpress Examples) contain references to the BindToDataSource(Object, Int32, Int32) 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.
// Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1);
}
winforms-spreadsheet-bind-to-ms-sql-server-database/CS/SuppliersExample/Form1.cs#L32
// Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1);
}
' Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1)
End Sub
winforms-spreadsheet-bind-to-ms-sql-server-database/VB/SuppliersExample/Form1.vb#L35
' Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1)
End Sub
See Also
Data Binding in WinForms Spreadsheet Control
WorksheetDataBindingCollection Interface