Export (0) Print
Expand All
Expand Minimize

DataGridViewCell.PositionEditingControl Method

Sets the location and size of the editing control hosted by a cell in the DataGridView control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

Public Overridable Sub PositionEditingControl ( _
	setLocation As Boolean, _
	setSize As Boolean, _
	cellBounds As Rectangle, _
	cellClip As Rectangle, _
	cellStyle As DataGridViewCellStyle, _
	singleVerticalBorderAdded As Boolean, _
	singleHorizontalBorderAdded As Boolean, _
	isFirstDisplayedColumn As Boolean, _
	isFirstDisplayedRow As Boolean _


Type: System.Boolean

true to have the control placed as specified by the other arguments; false to allow the control to place itself.

Type: System.Boolean

true to specify the size; false to allow the control to size itself.

Type: System.Drawing.Rectangle

A Rectangle that defines the cell bounds.

Type: System.Drawing.Rectangle

The area that will be used to paint the editing control.

Type: System.Windows.Forms.DataGridViewCellStyle

A DataGridViewCellStyle that represents the style of the cell being edited.

Type: System.Boolean

true to add a vertical border to the cell; otherwise, false.

Type: System.Boolean

true to add a horizontal border to the cell; otherwise, false.

Type: System.Boolean

true if the hosting cell is in the first visible column; otherwise, false.

Type: System.Boolean

true if the hosting cell is in the first visible row; otherwise, false.


The cell is not contained within a DataGridView control.

Some classes derived from the DataGridViewCell class, such as DataGridViewComboBoxCell, host a control in the selected cell. The PositionEditingControl method positions the editing control inside of the host cell. Because the editing control may take up more space than a single cell, it may need to be positioned differently when editing a cell in the first visible column or first visible row so it does not paint outside the DataGridView.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

© 2014 Microsoft