Export (0) Print
Expand All

DataGridViewColumnHeaderCell.GetClipboardContent Method

Retrieves the formatted value of the cell to copy to the Clipboard.

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

protected override Object GetClipboardContent(
	int rowIndex,
	bool firstCell,
	bool lastCell,
	bool inFirstRow,
	bool inLastRow,
	string format
)

Parameters

rowIndex
Type: System.Int32
The zero-based index of the row containing the cell.
firstCell
Type: System.Boolean
true to indicate that the cell is in the first column of the region defined by the selected cells; otherwise, false.
lastCell
Type: System.Boolean
true to indicate that the cell is the last column of the region defined by the selected cells; otherwise, false.
inFirstRow
Type: System.Boolean
true to indicate that the cell is in the first row of the region defined by the selected cells; otherwise, false.
inLastRow
Type: System.Boolean
true to indicate that the cell is in the last row of the region defined by the selected cells; otherwise, false.
format
Type: System.String
The current format string of the cell.

Return Value

Type: System.Object
A Object that represents the value of the cell to copy to the Clipboard.

ExceptionCondition
ArgumentOutOfRangeException

rowIndex is not -1.

Depending on the value of the ClipboardCopyMode property of the DataGridView control, this method is called by the control's GetClipboardContent method to retrieve a clipboard-formatted value that represents the cell.

The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the DataGridView control. Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row.

The supported clipboard formats include DataFormats.Text, DataFormats.UnicodeText, DataFormats.Html, and DataFormats.CommaSeparatedValue.

For more information, see the Clipboard class.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2015 Microsoft