SpreadsheetControl.GetCellBounds(Int32, Int32) Method

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

Namespace: DevExpress.Xpf.Spreadsheet

Assembly: DevExpress.Xpf.Spreadsheet.v21.2.dll


public Rect GetCellBounds(
    int rowIndex,
    int columnIndex


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.


Type Description

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


The GetCellBounds method returns the Rect 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.


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 a merged cell, the boundaries of returned rectangle will equal the bounds of the entire merged cell.

See Also