Skip to main content
All docs
V24.2
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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