PaintCells Method
This documentation is archived and is not being maintained.

DataGridViewRow.PaintCells Method

Note: This method is new in the .NET Framework version 2.0.

Paints the cells in the current row.

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

protected internal virtual void PaintCells (
	Graphics graphics,
	Rectangle clipBounds,
	Rectangle rowBounds,
	int rowIndex,
	DataGridViewElementStates rowState,
	bool isFirstDisplayedRow,
	bool isLastVisibleRow,
	DataGridViewPaintParts paintParts
)
protected void PaintCells (
	Graphics graphics, 
	Rectangle clipBounds, 
	Rectangle rowBounds, 
	int rowIndex, 
	DataGridViewElementStates rowState, 
	boolean isFirstDisplayedRow, 
	boolean isLastVisibleRow, 
	DataGridViewPaintParts paintParts
)
protected internal function PaintCells (
	graphics : Graphics, 
	clipBounds : Rectangle, 
	rowBounds : Rectangle, 
	rowIndex : int, 
	rowState : DataGridViewElementStates, 
	isFirstDisplayedRow : boolean, 
	isLastVisibleRow : boolean, 
	paintParts : DataGridViewPaintParts
)

Parameters

graphics

The Graphics used to paint the DataGridViewRow.

clipBounds

A Rectangle that represents the area of the DataGridView that needs to be painted.

rowBounds

A Rectangle that contains the bounds of the DataGridViewRow that is being painted.

rowIndex

The row index of the cell that is being painted.

rowState

A bitwise combination of DataGridViewElementStates values that specifies the state of the row.

isFirstDisplayedRow

true to indicate whether the current row is the first row displayed in the DataGridView; otherwise, false.

isLastVisibleRow

true to indicate whether the current row is the last row in the DataGridView that has the Visible property set to true; otherwise, false.

paintParts

A bitwise combination of DataGridViewPaintParts values indicating the parts of the cells to paint.

Exception typeCondition

InvalidOperationException

The row has not been added to a DataGridView control.

ArgumentException

paintParts in not a valid bitwise combination of DataGridViewPaintParts values.

The DataGridView control calls this method to paint the cells in the row except when a handler for the DataGridView.RowPrePaint event sets the HandledEventArgs.Handled property to true. For more information, see Paint.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show:
© 2016 Microsoft