Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

DataGridView.GetCellDisplayRectangle Method

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public Rectangle GetCellDisplayRectangle (
	int columnIndex,
	int rowIndex,
	bool cutOverflow
)
public Rectangle GetCellDisplayRectangle (
	int columnIndex, 
	int rowIndex, 
	boolean cutOverflow
)
public function GetCellDisplayRectangle (
	columnIndex : int, 
	rowIndex : int, 
	cutOverflow : boolean
) : Rectangle
Not applicable.

Parameters

columnIndex

The column index for the desired cell.

rowIndex

The row index for the desired cell.

cutOverflow

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

Return Value

The Rectangle that represents the display rectangle of the cell.

Exception typeCondition

ArgumentOutOfRangeException

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.

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft