WorksheetDataBindingCollection.GetDataBindings(Range) Method
Obtains data bindings for the cells in the specified range.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v19.1.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
range | Range | A Range of cells in a worksheet. |
Returns
Type | Description |
---|---|
IList<WorksheetDataBinding> | A IList<T><WorksheetDataBinding,> generic list . |
Remarks
To get the data binding for a particular cell, use the WorksheetDataBindingCollection.GetDataBinding method.
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-bind-a-worksheet-to-a-generic-list-or-a-bindinglist-data-source-t480285
Worksheet sheet = spreadsheetControl1.Document.Worksheets.ActiveWorksheet;
var bindings = sheet.DataBindings.GetDataBindings(sheet.Selection);
string s = "No data bindings found";
if (bindings.Count != 0) {
s = "The selected range contains the following data bindings:\r\n";
foreach (WorksheetDataBinding binding in bindings)
s += String.Format("Binding {0}\r\n", binding.Range);
}
MessageBox.Show(s);
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetDataBindings(Range) 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.