Skip to main content

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

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public Rect 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
Rect

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

Remarks

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.

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

See Also