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 virtual void PositionEditingControl (
	bool setLocation,
	bool setSize,
	Rectangle cellBounds,
	Rectangle cellClip,
	DataGridViewCellStyle cellStyle,
	bool singleVerticalBorderAdded,
	bool singleHorizontalBorderAdded,
	bool isFirstDisplayedColumn,
	bool isFirstDisplayedRow
)
public void PositionEditingControl (
	boolean setLocation, 
	boolean setSize, 
	Rectangle cellBounds, 
	Rectangle cellClip, 
	DataGridViewCellStyle cellStyle, 
	boolean singleVerticalBorderAdded, 
	boolean singleHorizontalBorderAdded, 
	boolean isFirstDisplayedColumn, 
	boolean isFirstDisplayedRow
)
public function PositionEditingControl (
	setLocation : boolean, 
	setSize : boolean, 
	cellBounds : Rectangle, 
	cellClip : Rectangle, 
	cellStyle : DataGridViewCellStyle, 
	singleVerticalBorderAdded : boolean, 
	singleHorizontalBorderAdded : boolean, 
	isFirstDisplayedColumn : boolean, 
	isFirstDisplayedRow : boolean
)
Not applicable.

Parameters

setLocation

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

setSize

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

cellBounds

A Rectangle that defines the cell bounds.

cellClip

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

cellStyle

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

singleVerticalBorderAdded

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

singleHorizontalBorderAdded

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

isFirstDisplayedColumn

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

isFirstDisplayedRow

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

Exception typeCondition

InvalidOperationException

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.

Windows 98, Windows Server 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 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:
© 2014 Microsoft