Skip to main content
All docs
V24.1
Row

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.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public static void Select(
    this CellRange range,
    bool expandToMergedCells
)

Parameters

Name Type Description
range CellRange

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.

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

Include a merged cell in selection

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

Exclude merged cells from selection

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

See Also