DataGridView.GetCellDisplayRectangle(Int32, Int32, Boolean) Method

Definition

Returns the rectangle that represents the display area for a cell.

public:
 System::Drawing::Rectangle GetCellDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow);
public System.Drawing.Rectangle GetCellDisplayRectangle (int columnIndex, int rowIndex, bool cutOverflow);
member this.GetCellDisplayRectangle : int * int * bool -> System.Drawing.Rectangle
Public Function GetCellDisplayRectangle (columnIndex As Integer, rowIndex As Integer, cutOverflow As Boolean) As Rectangle

Parameters

columnIndex
Int32

The column index for the desired cell.

rowIndex
Int32

The row index for the desired cell.

cutOverflow
Boolean

true to return the displayed portion of the cell only; false to return the entire cell bounds.

Returns

The Rectangle that represents the display rectangle of the cell.

Exceptions

columnIndex is less than -1 or greater than the number of columns in the control minus 1.

-or-

rowIndex is less than -1 or greater than the number of rows in the control minus 1.

Remarks

This method returns the entire cell bounds or the displayed portion only. To get the bounds of the cell contents only, use the cell ContentBounds property.

Applies to

See also