officefileapi-devexpress-dot-spreadsheet-dot-worksheetdatabinding.md
Gets the worksheet range associated with the current WorksheetDataBinding instance.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
CellRange Range { get; }
ReadOnly Property Range As CellRange
| Type | Description |
|---|---|
| CellRange |
A CellRange object that is a cell range associated with a data source.
|
The range may include cells which are not bound to data. This happens when the range contains hidden columns or rows and the DataSourceOptionsBase.SkipHiddenColumns or DataSourceOptionsBase.SkipHiddenRows option is turned on when calling the WorksheetDataBindingCollection.BindToDataSource method.
A range used for data binding cannot have merged cells.
The SpreadsheetControl does not indicate the range visually.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Range 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.
CellRange rowRange = sheet.Range.FromLTRB(0, e.StartIndex, 16383, e.StartIndex + e.Count - 1);
CellRange boundRange = sheet.DataBindings[0].Range;
// If the rows to be removed belong to the data-bound range,
winforms-spreadsheet-bind-to-ms-sql-server-database/CS/SuppliersExample/Form1.cs#L91
CellRange rowRange = sheet.Range.FromLTRB(0, e.StartIndex, 16383, e.StartIndex + e.Count - 1);
CellRange boundRange = sheet.DataBindings[0].Range;
// If the rows to be removed belong to the data-bound range,
foreach (WorksheetDataBinding binding in bindings)
message += String.Format("Binding {0}\r\n", binding.Range);
}
Dim rowRange As CellRange = sheet.Range.FromLTRB(0, e.StartIndex, 16383, e.StartIndex + e.Count - 1)
Dim boundRange As CellRange = sheet.DataBindings(0).Range
' If the rows to be removed belong to the data-bound range,
winforms-spreadsheet-bind-to-ms-sql-server-database/VB/SuppliersExample/Form1.vb#L87
Dim rowRange As CellRange = sheet.Range.FromLTRB(0, e.StartIndex, 16383, e.StartIndex + e.Count - 1)
Dim boundRange As CellRange = sheet.DataBindings(0).Range
' If the rows to be removed belong to the data-bound range,
For Each binding As WorksheetDataBinding In bindings
message &= String.Format("Binding {0}" & ControlChars.CrLf, binding.Range)
Next binding
See Also