Skip to main content
A newer version of this page is available. .

SpreadsheetControl.GetCellBounds(Int32, Int32) Method

Obtains the coordinates and size of a cell specified by the row and column indices.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v19.1.dll

Declaration

public Rectangle GetCellBounds(
    int rowIndex,
    int columnIndex
)

Parameters

Name Type Description
rowIndex Int32

An integer that is the zero-based index of the row that contains the required cell.

columnIndex Int32

An integer that is the zero-based index of the column that contains the required cell.

Returns

Type Description
Rectangle

A Rectangle object that is the rectangle with the specified location and size in pixels.

Remarks

The GetCellBounds method returns the Rectangle object that specifies a cell’s x- and y-coordinates relative to the SpreadsheetControl‘s top-left corner, and the cell’s width and height.

SpreadsheetControl_GetCellBounds

The GetCellBounds method takes into account zoom settings specified for an active worksheet (SpreadsheetControl.ActiveViewZoom).

If the cell you specify is out of the currently visible range (defined by the SpreadsheetControl.VisibleRange property), the GetCellBounds method returns an empty rectangle.

If the specified cell is a part of the merged cell, the boundaries of returned rectangle will equal the bounds of the entire merged cell.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetCellBounds(Int32, Int32) method.

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.

See Also