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.v20.1.dll


public Rectangle GetCellBounds(
    int rowIndex,
    int columnIndex
Public Function GetCellBounds(
    rowIndex As Integer,
    columnIndex As Integer
) As Rectangle


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 Rectangle object that is the rectangle with the specified location and size in pixels.


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.


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.

See Also