Back to Devexpress

WorksheetDataBinding.Range Property

officefileapi-devexpress-dot-spreadsheet-dot-worksheetdatabinding.md

latest5.5 KB
Original Source

WorksheetDataBinding.Range Property

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

Declaration

csharp
CellRange Range { get; }
vb
ReadOnly Property Range As CellRange

Property Value

TypeDescription
CellRange

A CellRange object that is a cell range associated with a data source.

|

Remarks

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.

wpf-spreadsheet-bind-spreadsheet-to-ms-sql-server-database/CS/WpfSpreadsheet_BindToDataSource/MainWindow.xaml.cs#L110

csharp
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

csharp
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,

how-to-bind-a-worksheet-to-a-generic-list-or-a-bindinglist-data-source/CS/DataBindingToListExample/Form1.cs#L135

csharp
foreach (WorksheetDataBinding binding in bindings)
        message += String.Format("Binding {0}\r\n", binding.Range);
}

wpf-spreadsheet-bind-spreadsheet-to-ms-sql-server-database/VB/WpfSpreadsheet_BindToDataSource/MainWindow.xaml.vb#L93

vb
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

vb
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,

how-to-bind-a-worksheet-to-a-generic-list-or-a-bindinglist-data-source/VB/DataBindingToListExample/Form1.vb#L132

vb
For Each binding As WorksheetDataBinding In bindings
    message &= String.Format("Binding {0}" & ControlChars.CrLf, binding.Range)
Next binding

See Also

WorksheetDataBinding Interface

WorksheetDataBinding Members

DevExpress.Spreadsheet Namespace