Back to Devexpress

CellRange.LeftColumnIndex Property

officefileapi-devexpress-dot-spreadsheet-dot-cellrange-b95dd29d.md

latest6.9 KB
Original Source

CellRange.LeftColumnIndex Property

Gets the index of the column that includes the left edge of the cell range.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
int LeftColumnIndex { get; }
vb
ReadOnly Property LeftColumnIndex As Integer

Property Value

TypeDescription
Int32

An integer value specifying the zero-based index of the column.

|

Remarks

Use the LeftColumnIndex , CellRange.RightColumnIndex, CellRange.TopRowIndex and CellRange.BottomRowIndex properties to get indexes of columns and rows that border the cell range.

To obtain the number of rows or columns in the cell range, use the CellRange.RowCount or CellRange.ColumnCount property, respectively.

The following code snippets (auto-collected from DevExpress Examples) contain references to the LeftColumnIndex 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.

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

csharp
var dataBindingConflicts = sheet.DataBindings.
    Where(binding => (binding.Range.RightColumnIndex >= bindingRange.LeftColumnIndex)
    || (binding.Range.BottomRowIndex >= bindingRange.TopRowIndex)) ;

winforms-spreadsheet-import-data-from-a-datatable-instance/CS/Form1.cs#L27

csharp
spreadsheetControl1.BeginUpdate();
activeWorksheet.Import(ManualDataSet.CreateData().Tables[0], true, selection.TopRowIndex, selection.LeftColumnIndex);
spreadsheetControl1.EndUpdate();

winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L187

csharp
CellRange range = invoiceItems.Range;
CellRange itemRange = sheet.Range.FromLTRB(range.LeftColumnIndex, range.BottomRowIndex, range.RightColumnIndex, range.BottomRowIndex);
MoveUpLastRecord(itemRange);

spreadsheet-document-api-data-binding/CS/SpreadsheetApiDataBinding/Program.cs#L38

csharp
var dataBindingConflicts = worksheet.DataBindings.
    Where(binding => (binding.Range.RightColumnIndex >= bindingRange.LeftColumnIndex)
    || (binding.Range.BottomRowIndex >= bindingRange.TopRowIndex));

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

vb
Function(binding)
    Return (binding.Range.RightColumnIndex >= bindingRange.LeftColumnIndex) OrElse (binding.Range.BottomRowIndex >= bindingRange.TopRowIndex)
End Function)

winforms-spreadsheet-import-data-from-a-datatable-instance/VB/Form1.vb#L30

vb
spreadsheetControl1.BeginUpdate()
activeWorksheet.Import(ManualDataSet.CreateData().Tables(0), True, selection.TopRowIndex, selection.LeftColumnIndex)
spreadsheetControl1.EndUpdate()

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L174

vb
Dim range As CellRange = invoiceItems.Range
Dim itemRange As CellRange = sheet.Range.FromLTRB(range.LeftColumnIndex, range.BottomRowIndex, range.RightColumnIndex, range.BottomRowIndex)
MoveUpLastRecord(itemRange)

spreadsheet-document-api-data-binding/VB/SpreadsheetApiDataBinding/Program.vb#L34

vb
Dim bindingRange As CellRange = worksheet.Range("A1:C5")
Dim dataBindingConflicts = worksheet.DataBindings.Where(Function(binding) (binding.Range.RightColumnIndex >= bindingRange.LeftColumnIndex) OrElse (binding.Range.BottomRowIndex >= bindingRange.TopRowIndex))
If dataBindingConflicts.Count() > 0 Then

See Also

RightColumnIndex

TopRowIndex

BottomRowIndex

How to: Access a Range of Cells

How to: Access a Row or Column

CellRange Interface

CellRange Members

DevExpress.Spreadsheet Namespace