officefileapi-devexpress-dot-spreadsheet-dot-worksheet-005f916a.md
Provides access to the collection of WorksheetDataBinding objects.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
WorksheetDataBindingCollection DataBindings { get; }
ReadOnly Property DataBindings As WorksheetDataBindingCollection
| Type | Description |
|---|---|
| WorksheetDataBindingCollection |
A WorksheetDataBindingCollection object that is the collection of all data bindings specified in a worksheet.
|
Use the DataBindings property to get access to the WorksheetDataBindingCollection collection, which stores all data bindings specified in a worksheet. To bind a cell range in a worksheet to a data source, use the WorksheetDataBindingCollection.BindToDataSource method.
To use a cell range as a data source for a data-aware control, create a data source object from the required cell range using the WorksheetDataBindingCollection.CreateDataSource method.
For more information on the data binding functionality of the SpreadsheetControl, refer to the Data Binding topic.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataBindings property.
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.
private void barBtnUnbind_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
foreach (WorksheetDataBinding wdb in spreadsheetControl1.Document.Worksheets[0].DataBindings)
wdb.Range.FillColor = System.Drawing.Color.Empty;
Private Sub barBtnUnbind_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
For Each wdb As WorksheetDataBinding In spreadsheetControl1.Document.Worksheets(0).DataBindings
wdb.Range.FillColor = System.Drawing.Color.Empty
See Also
Data Binding in WinForms Spreadsheet Control