Back to Devexpress

RangeExtensions.Select(CellRange, Boolean) Method

officefileapi-devexpress-dot-spreadsheet-dot-rangeextensions-dot-select-x28-devexpress-dot-spreadsheet-dot-cellrange-system-dot-boolean-x29.md

latest2.8 KB
Original Source

RangeExtensions.Select(CellRange, Boolean) Method

Selects the cell range and specifies whether to expand cell selection to include merged cells.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public static void Select(
    this CellRange range,
    bool expandToMergedCells
)
vb
<ExtensionAttribute>
Public Shared Sub Select(
    range As CellRange,
    expandToMergedCells As Boolean
)

Parameters

NameTypeDescription
rangeCellRange

The cell range to select.

| | expandToMergedCells | Boolean |

true to include merged cells in the selected range; otherwise, false.

|

Remarks

Set the expandToMergedCells parameter to true to include merged cells in the selected range, as shown in the example below.

csharp
Worksheet worksheet = workbook.Worksheets[0];
worksheet.MergeCells(worksheet.Range["B3:D6"]);
worksheet["A2:C4"].Select(true);
vb
Dim worksheet As Worksheet = workbook.Worksheets(0)
worksheet.MergeCells(worksheet.Range("B3:D6"))
worksheet("A2:C4").Select(True)

If the expandToMergedCells parameter is false , cell selection does not expand to include merged cells.

You can also use the following API members to select cells in a worksheet:

See Also

RangeExtensions Class

RangeExtensions Members

DevExpress.Spreadsheet Namespace