Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
4621 lines (4227 sloc) 352 KB
<Type Name="DataGridViewCell" FullName="System.Windows.Forms.DataGridViewCell">
<TypeSignature Language="C#" Value="public abstract class DataGridViewCell : System.Windows.Forms.DataGridViewElement, ICloneable, IDisposable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit DataGridViewCell extends System.Windows.Forms.DataGridViewElement implements class System.ICloneable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.DataGridViewCell" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class DataGridViewCell&#xA;Inherits DataGridViewElement&#xA;Implements ICloneable, IDisposable" />
<TypeSignature Language="C++ CLI" Value="public ref class DataGridViewCell abstract : System::Windows::Forms::DataGridViewElement, ICloneable, IDisposable" />
<TypeSignature Language="F#" Value="type DataGridViewCell = class&#xA; inherit DataGridViewElement&#xA; interface ICloneable&#xA; interface IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.DataGridViewElement</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataGridViewCellConverter))</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents an individual cell in a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell> class represents an individual cell in a <xref:System.Windows.Forms.DataGridView> control. You can retrieve cells through the <xref:System.Windows.Forms.DataGridViewRow.Cells%2A> collection of a <xref:System.Windows.Forms.DataGridViewRow>.
The row and column for a <xref:System.Windows.Forms.DataGridViewCell> identify the cell's location in the <xref:System.Windows.Forms.DataGridView>. A typical cell contains data specific to the row and column in which it is contained. The cell can be customized in a number of ways by setting its properties and handling the events associated with it.
## Examples
The following code example illustrates the use of this type. For more information about this example, see [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](~/docs/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control.md).
[!code-cpp[System.Windows.Forms.DataGridViewCell.ToolTipText#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp#1)]
[!code-csharp[System.Windows.Forms.DataGridViewCell.ToolTipText#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/CS/datagridviewcell.tooltiptext.cs#1)]
[!code-vb[System.Windows.Forms.DataGridViewCell.ToolTipText#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/VB/datagridviewcell.tooltiptext.vb#1)]
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When you derive from <see cref="T:System.Windows.Forms.DataGridViewCell" /> and add new properties to the derived class, be sure to override the <see cref="M:System.Windows.Forms.DataGridViewCell.Clone" /> method to copy the new properties during cloning operations. You should also call the base class's <see cref="M:System.Windows.Forms.DataGridViewCell.Clone" /> method so that the properties of the base class are copied to the new cell.</para>
</block>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.ICloneable" />
<altmember cref="T:System.IDisposable" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected DataGridViewCell ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; DataGridViewCell();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCell" /> class.</summary>
<remarks>To be added.</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="AccessibilityObject">
<MemberSignature Language="C#" Value="public System.Windows.Forms.AccessibleObject AccessibilityObject { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.AccessibleObject AccessibilityObject" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.AccessibilityObject" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property AccessibilityObject As AccessibleObject" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::AccessibleObject ^ AccessibilityObject { System::Windows::Forms::AccessibleObject ^ get(); };" />
<MemberSignature Language="F#" Value="member this.AccessibilityObject : System.Windows.Forms.AccessibleObject" Usage="System.Windows.Forms.DataGridViewCell.AccessibilityObject" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.AccessibleObject</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject" /> assigned to the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary>
<value>The <see cref="T:System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject" /> assigned to the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To control the instance returned from this method, override the <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A> method.
If no <xref:System.Windows.Forms.AccessibleObject> is currently assigned to the control, a new instance of one is created.
> [!NOTE]
> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)].
For more information about accessible objects, see the "Active Accessibility" section of the MSDN Library at [http://msdn.microsoft.com/library](https://msdn.microsoft.com/library).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="AdjustCellBorderStyle">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.DataGridViewAdvancedBorderStyle AdjustCellBorderStyle (System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Windows.Forms.DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(class System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, class System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle(System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Boolean,System.Boolean,System.Boolean,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function AdjustCellBorderStyle (dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, dataGridViewAdvancedBorderStylePlaceholder As DataGridViewAdvancedBorderStyle, singleVerticalBorderAdded As Boolean, singleHorizontalBorderAdded As Boolean, isFirstDisplayedColumn As Boolean, isFirstDisplayedRow As Boolean) As DataGridViewAdvancedBorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ AdjustCellBorderStyle(System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStyleInput, System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);" />
<MemberSignature Language="F#" Value="abstract member AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -&gt; System.Windows.Forms.DataGridViewAdvancedBorderStyle&#xA;override this.AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -&gt; System.Windows.Forms.DataGridViewAdvancedBorderStyle" Usage="dataGridViewCell.AdjustCellBorderStyle (dataGridViewAdvancedBorderStyleInput, dataGridViewAdvancedBorderStylePlaceholder, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridViewAdvancedBorderStyle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataGridViewAdvancedBorderStyleInput" Type="System.Windows.Forms.DataGridViewAdvancedBorderStyle" />
<Parameter Name="dataGridViewAdvancedBorderStylePlaceholder" Type="System.Windows.Forms.DataGridViewAdvancedBorderStyle" />
<Parameter Name="singleVerticalBorderAdded" Type="System.Boolean" />
<Parameter Name="singleHorizontalBorderAdded" Type="System.Boolean" />
<Parameter Name="isFirstDisplayedColumn" Type="System.Boolean" />
<Parameter Name="isFirstDisplayedRow" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="dataGridViewAdvancedBorderStyleInput">A <see cref="T:System.Windows.Forms.DataGridViewAdvancedBorderStyle" /> that represents the cell border style to modify.</param>
<param name="dataGridViewAdvancedBorderStylePlaceholder">A <see cref="T:System.Windows.Forms.DataGridViewAdvancedBorderStyle" /> that is used to store intermediate changes to the cell border style.</param>
<param name="singleVerticalBorderAdded">
<see langword="true" /> to add a vertical border to the cell; otherwise, <see langword="false" />.</param>
<param name="singleHorizontalBorderAdded">
<see langword="true" /> to add a horizontal border to the cell; otherwise, <see langword="false" />.</param>
<param name="isFirstDisplayedColumn">
<see langword="true" /> if the hosting cell is in the first visible column; otherwise, <see langword="false" />.</param>
<param name="isFirstDisplayedRow">
<see langword="true" /> if the hosting cell is in the first visible row; otherwise, <see langword="false" />.</param>
<summary>Modifies the input cell border style according to the specified criteria.</summary>
<returns>The modified <see cref="T:System.Windows.Forms.DataGridViewAdvancedBorderStyle" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridView> control internally calls the <xref:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle%2A> method to determine the appearance of the cell borders. The <xref:System.Windows.Forms.DataGridView> control typically uses the value of the <xref:System.Windows.Forms.DataGridView.AdvancedCellBorderStyle%2A> property for the `dataGridViewAdvancedBorderStyleInput` parameter.
The <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle.OutsetPartial?displayProperty=nameWithType> value is not supported as an input style for cells.
## Examples
The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle%2A> method to customize the borders of the cells. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewAdvancedBorderStyle> class.
[!code-csharp[System.Windows.Forms.DataGridViewAdvancedBorderStyle#20](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewAdvancedBorderStyle/CS/advancedborderstyle.cs#20)]
[!code-vb[System.Windows.Forms.DataGridViewAdvancedBorderStyle#20](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewAdvancedBorderStyle/VB/advancedborderstyle.vb#20)]
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>Override this method if you want to customize the appearance of the cell borders.</para>
</block>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle,System.Int32,System.Boolean)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.HasStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" />
</Docs>
</Member>
<Member MemberName="BorderWidths">
<MemberSignature Language="C#" Value="protected virtual System.Drawing.Rectangle BorderWidths (System.Windows.Forms.DataGridViewAdvancedBorderStyle advancedBorderStyle);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance valuetype System.Drawing.Rectangle BorderWidths(class System.Windows.Forms.DataGridViewAdvancedBorderStyle advancedBorderStyle) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.BorderWidths(System.Windows.Forms.DataGridViewAdvancedBorderStyle)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function BorderWidths (advancedBorderStyle As DataGridViewAdvancedBorderStyle) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Drawing::Rectangle BorderWidths(System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ advancedBorderStyle);" />
<MemberSignature Language="F#" Value="abstract member BorderWidths : System.Windows.Forms.DataGridViewAdvancedBorderStyle -&gt; System.Drawing.Rectangle&#xA;override this.BorderWidths : System.Windows.Forms.DataGridViewAdvancedBorderStyle -&gt; System.Drawing.Rectangle" Usage="dataGridViewCell.BorderWidths advancedBorderStyle" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="advancedBorderStyle" Type="System.Windows.Forms.DataGridViewAdvancedBorderStyle" />
</Parameters>
<Docs>
<param name="advancedBorderStyle">A <see cref="T:System.Windows.Forms.DataGridViewAdvancedBorderStyle" /> that the margins are to be calculated for.</param>
<summary>Returns a <see cref="T:System.Drawing.Rectangle" /> that represents the widths of all the cell margins.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the widths of all the cell margins.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The default width of the cell border is one pixel. Use the following <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle> values to modify the width of the border:
- The <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle.None> value denotes a width of 0 pixels.
- The <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle.OutsetDouble> or <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle.InsetDouble> values increase the default width by 1 pixel.
In addition, if the <xref:System.Windows.Forms.DataGridViewRow.DividerHeight%2A> property is set for the cell's owning row, the rectangle's height is increased by the value of <xref:System.Windows.Forms.DataGridViewRow.DividerHeight%2A>. If the <xref:System.Windows.Forms.DataGridViewColumn.DividerWidth%2A> property is set for the cell's owning column, the rectangle's width will be increased by the value of <xref:System.Windows.Forms.DataGridViewColumn.DividerWidth%2A>.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.BorderWidths%2A> method of the <xref:System.Windows.Forms.DataGridViewCell> class to determine the available drawing area in a cell. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid.md).
[!code-csharp[System.Windows.Forms.DataGridView.DisabledButtons#20](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/CS/form1.cs#20)]
[!code-vb[System.Windows.Forms.DataGridView.DisabledButtons#20](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb#20)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataGridViewCellBorderStyle" />
<altmember cref="T:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle" />
</Docs>
</Member>
<Member MemberName="ClickUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool ClickUnsharesRow (System.Windows.Forms.DataGridViewCellEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool ClickUnsharesRow(class System.Windows.Forms.DataGridViewCellEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.ClickUnsharesRow(System.Windows.Forms.DataGridViewCellEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function ClickUnsharesRow (e As DataGridViewCellEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool ClickUnsharesRow(System::Windows::Forms::DataGridViewCellEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member ClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool&#xA;override this.ClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool" Usage="dataGridViewCell.ClickUnsharesRow e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.DataGridViewCellEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> containing the data passed to the <see cref="M:System.Windows.Forms.DataGridViewCell.OnClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method.</param>
<summary>Indicates whether the cell's row will be unshared when the cell is clicked.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.ClickUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnClick%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnClick%2A> has the effect of unsharing the cell's row. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnClick(System.Windows.Forms.DataGridViewCellEventArgs)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="public virtual object Clone ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.Clone" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Clone () As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Object ^ Clone();" />
<MemberSignature Language="F#" Value="abstract member Clone : unit -&gt; obj&#xA;override this.Clone : unit -&gt; obj" Usage="dataGridViewCell.Clone " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ICloneable.Clone</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an exact copy of this cell.</summary>
<returns>An <see cref="T:System.Object" /> that represents the cloned <see cref="T:System.Windows.Forms.DataGridViewCell" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Override the <xref:System.Windows.Forms.DataGridViewCell.Clone%2A> method whenever you derive from the <xref:System.Windows.Forms.DataGridViewCell> class and add new properties to the derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding the <see cref="M:System.Windows.Forms.DataGridViewCell.Clone" /> method in a derived class, call the base class's <see cref="M:System.Windows.Forms.DataGridViewCell.Clone" /> method so that the properties of the base class are copied to the new cell, and be sure to also copy the values of any properties that were added to the derived class.</para>
</block>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="ColumnIndex">
<MemberSignature Language="C#" Value="public int ColumnIndex { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ColumnIndex" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ColumnIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int ColumnIndex { int get(); };" />
<MemberSignature Language="F#" Value="member this.ColumnIndex : int" Usage="System.Windows.Forms.DataGridViewCell.ColumnIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the column index for this cell.</summary>
<value>The index of the column that contains the cell; -1 if the cell is not contained within a column.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The column index for the row that contains the row headers has a value of -1.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.ColumnIndex%2A> property to determine which columns to check for integer values. In this example, the cells in the `Description` column are ignored when the contents of the selected cells are summed. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event.
[!code-csharp[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/CS/form1.cs#10)]
[!code-vb[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb#10)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.RowIndex" />
</Docs>
</Member>
<Member MemberName="ContentBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle ContentBounds { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Rectangle ContentBounds" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.ContentBounds" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ContentBounds As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Rectangle ContentBounds { System::Drawing::Rectangle get(); };" />
<MemberSignature Language="F#" Value="member this.ContentBounds : System.Drawing.Rectangle" Usage="System.Windows.Forms.DataGridViewCell.ContentBounds" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the bounding rectangle that encloses the cell's content area.</summary>
<value>The <see cref="T:System.Drawing.Rectangle" /> that bounds the cell's contents.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The returned rectangle reports client coordinates, in pixels.
This property calls the <xref:System.Windows.Forms.DataGridViewCell.GetContentBounds%2A> method to get its value. For the base <xref:System.Windows.Forms.DataGridViewCell> type, this value is <xref:System.Drawing.Rectangle.Empty>.
To get the bounding rectangle of the cell rather than the cell contents, use the <xref:System.Windows.Forms.DataGridView.GetCellDisplayRectangle%2A?displayProperty=nameWithType> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The row containing the cell is a shared row.
-or-
The cell is a column header cell.</exception>
<exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> property is less than 0, indicating that the cell is a row header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridView.GetCellDisplayRectangle(System.Int32,System.Int32,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetContentBounds(System.Drawing.Graphics,System.Windows.Forms.DataGridViewCellStyle,System.Int32)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Size" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.PreferredSize" />
<altmember cref="F:System.Drawing.Rectangle.Empty" />
</Docs>
</Member>
<Member MemberName="ContentClickUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool ContentClickUnsharesRow (System.Windows.Forms.DataGridViewCellEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool ContentClickUnsharesRow(class System.Windows.Forms.DataGridViewCellEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.ContentClickUnsharesRow(System.Windows.Forms.DataGridViewCellEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function ContentClickUnsharesRow (e As DataGridViewCellEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool ContentClickUnsharesRow(System::Windows::Forms::DataGridViewCellEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member ContentClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool&#xA;override this.ContentClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool" Usage="dataGridViewCell.ContentClickUnsharesRow e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.DataGridViewCellEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> containing the data passed to the <see cref="M:System.Windows.Forms.DataGridViewCell.OnContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method.</param>
<summary>Indicates whether the cell's row will be unshared when the cell's content is clicked.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.ContentClickUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnContentClick%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnContentClick%2A> has the effect of unsharing the cell's row. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="ContentDoubleClickUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool ContentDoubleClickUnsharesRow (System.Windows.Forms.DataGridViewCellEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool ContentDoubleClickUnsharesRow(class System.Windows.Forms.DataGridViewCellEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.ContentDoubleClickUnsharesRow(System.Windows.Forms.DataGridViewCellEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function ContentDoubleClickUnsharesRow (e As DataGridViewCellEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool ContentDoubleClickUnsharesRow(System::Windows::Forms::DataGridViewCellEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member ContentDoubleClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool&#xA;override this.ContentDoubleClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool" Usage="dataGridViewCell.ContentDoubleClickUnsharesRow e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.DataGridViewCellEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> containing the data passed to the <see cref="M:System.Windows.Forms.DataGridViewCell.OnContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method.</param>
<summary>Indicates whether the cell's row will be unshared when the cell's content is double-clicked.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.ContentDoubleClickUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnContentDoubleClick%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnContentDoubleClick%2A> has the effect of unsharing the cell's row. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="ContextMenuStrip">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.ContextMenuStrip ContextMenuStrip { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ContextMenuStrip ContextMenuStrip" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.ContextMenuStrip" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ContextMenuStrip As ContextMenuStrip" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::ContextMenuStrip ^ ContextMenuStrip { System::Windows::Forms::ContextMenuStrip ^ get(); void set(System::Windows::Forms::ContextMenuStrip ^ value); };" />
<MemberSignature Language="F#" Value="member this.ContextMenuStrip : System.Windows.Forms.ContextMenuStrip with get, set" Usage="System.Windows.Forms.DataGridViewCell.ContextMenuStrip" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ContextMenuStrip</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the shortcut menu associated with the cell.</summary>
<value>The <see cref="T:System.Windows.Forms.ContextMenuStrip" /> associated with the cell.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property indicates the shortcut menu that is typically displayed when the user right-clicks the cell.
When the <xref:System.Windows.Forms.DataGridView> control <xref:System.Windows.Forms.DataGridView.DataSource%2A> property is set or its <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property is `true`, getting the value of the <xref:System.Windows.Forms.DataGridViewCell.ContextMenuStrip%2A> property raises the <xref:System.Windows.Forms.DataGridView.CellContextMenuStripNeeded> event of the control and returns the value of the <xref:System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs.ContextMenuStrip%2A?displayProperty=nameWithType> property as specified in the event handler. If there are no handlers for the event, getting the value of the <xref:System.Windows.Forms.DataGridViewCell.ContextMenuStrip%2A> property returns the previously specified value or its default value of `null`.
Handling the <xref:System.Windows.Forms.DataGridView.CellContextMenuStripNeeded> event is primarily useful when working with large amounts of data to avoid performance penalties when setting the cell <xref:System.Windows.Forms.DataGridViewCell.ContextMenuStrip%2A> value for multiple cells. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
Changing this property raises the <xref:System.Windows.Forms.DataGridView.CellContextMenuStripChanged> event on the owning <xref:System.Windows.Forms.DataGridView>, if one exists.
You can also specify shortcut menus for individual rows rather than individual cells by setting the row <xref:System.Windows.Forms.DataGridViewRow.ContextMenuStrip%2A> property or handling the <xref:System.Windows.Forms.DataGridView> control's <xref:System.Windows.Forms.DataGridView.RowContextMenuStripNeeded> event. The cell <xref:System.Windows.Forms.DataGridViewCell.ContextMenuStrip%2A> property setting overrides the row <xref:System.Windows.Forms.DataGridViewRow.ContextMenuStrip%2A> property setting, and the <xref:System.Windows.Forms.DataGridView.CellContextMenuStripNeeded> event overrides both the <xref:System.Windows.Forms.DataGridView.RowContextMenuStripNeeded> event and the row <xref:System.Windows.Forms.DataGridViewRow.ContextMenuStrip%2A> property setting. You can specify `null` for a cell shortcut menu, however, to prevent a row shortcut menu from being overridden.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellContextMenuStripChanged" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellContextMenuStripNeeded" />
<altmember cref="P:System.Windows.Forms.DataGridView.DataSource" />
<altmember cref="P:System.Windows.Forms.DataGridView.VirtualMode" />
<altmember cref="E:System.Windows.Forms.DataGridView.RowContextMenuStripNeeded" />
<altmember cref="P:System.Windows.Forms.DataGridViewRow.ContextMenuStrip" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetInheritedContextMenuStrip(System.Int32)" />
<altmember cref="T:System.Windows.Forms.ContextMenuStrip" />
</Docs>
</Member>
<Member MemberName="CreateAccessibilityInstance">
<MemberSignature Language="C#" Value="protected virtual System.Windows.Forms.AccessibleObject CreateAccessibilityInstance ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Windows.Forms.AccessibleObject CreateAccessibilityInstance() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.CreateAccessibilityInstance" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateAccessibilityInstance () As AccessibleObject" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Windows::Forms::AccessibleObject ^ CreateAccessibilityInstance();" />
<MemberSignature Language="F#" Value="abstract member CreateAccessibilityInstance : unit -&gt; System.Windows.Forms.AccessibleObject&#xA;override this.CreateAccessibilityInstance : unit -&gt; System.Windows.Forms.AccessibleObject" Usage="dataGridViewCell.CreateAccessibilityInstance " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.AccessibleObject</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new accessible object for the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary>
<returns>A new <see cref="T:System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject" /> for the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you do not explicitly call the <xref:System.Windows.Forms.DataGridViewCell.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A> property is referenced.
> [!NOTE]
> To get or set <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A>, you must add a reference to the `Accessibility` assembly installed with the [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)].
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.AccessibilityObject" />
<altmember cref="N:Accessibility" />
</Docs>
</Member>
<Member MemberName="DefaultNewRowValue">
<MemberSignature Language="C#" Value="public virtual object DefaultNewRowValue { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object DefaultNewRowValue" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.DefaultNewRowValue" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property DefaultNewRowValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Object ^ DefaultNewRowValue { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultNewRowValue : obj" Usage="System.Windows.Forms.DataGridViewCell.DefaultNewRowValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default value for a cell in the row for new records.</summary>
<value>An <see cref="T:System.Object" /> representing the default value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.DefaultNewRowValue%2A> property in the base class <xref:System.Windows.Forms.DataGridViewCell> always returns `null`. However, this property can be overridden in derived cell classes to return other default values.
The value returned by this property is displayed if the cell is in the row for new records. This value can be overridden by a handler for the <xref:System.Windows.Forms.DataGridView.DefaultValuesNeeded?displayProperty=nameWithType> event when focus enters the row for new records.
## Examples
The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.DefaultNewRowValue%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](~/docs/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells.md).
[!code-csharp[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/CS/datagridviewcalendarcolumn.cs#200)]
[!code-vb[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb#200)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValue" />
</Docs>
</Member>
<Member MemberName="DetachEditingControl">
<MemberSignature Language="C#" Value="public virtual void DetachEditingControl ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void DetachEditingControl() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.DetachEditingControl" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub DetachEditingControl ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void DetachEditingControl();" />
<MemberSignature Language="F#" Value="abstract member DetachEditingControl : unit -&gt; unit&#xA;override this.DetachEditingControl : unit -&gt; unit" Usage="dataGridViewCell.DetachEditingControl " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Removes the cell's editing control from the <see cref="T:System.Windows.Forms.DataGridView" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridView> calls this method when the current cell hosts an editing control and editing mode ends. This method removes the <xref:System.Windows.Forms.DataGridView.EditingControl%2A> from the <xref:System.Windows.Forms.DataGridView.EditingPanel%2A>, and then removes the <xref:System.Windows.Forms.DataGridView.EditingPanel%2A> from the <xref:System.Windows.Forms.Control.Controls%2A> collection of the <xref:System.Windows.Forms.DataGridView>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This cell is not associated with a <see cref="T:System.Windows.Forms.DataGridView" />.
-or-
The <see cref="P:System.Windows.Forms.DataGridView.EditingControl" /> property of the associated <see cref="T:System.Windows.Forms.DataGridView" /> has a value of <see langword="null" />. This is the case, for example, when the control is not in edit mode.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridView.EditingControl" />
<altmember cref="P:System.Windows.Forms.DataGridView.EditingPanel" />
<altmember cref="P:System.Windows.Forms.Control.Controls" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.InitializeEditingControl(System.Int32,System.Object,System.Windows.Forms.DataGridViewCellStyle)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.PositionEditingControl(System.Boolean,System.Boolean,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Windows.Forms.DataGridViewCellStyle,System.Boolean,System.Boolean,System.Boolean,System.Boolean)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.EditType" />
</Docs>
</Member>
<Member MemberName="Displayed">
<MemberSignature Language="C#" Value="public virtual bool Displayed { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Displayed" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.Displayed" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Displayed As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool Displayed { bool get(); };" />
<MemberSignature Language="F#" Value="member this.Displayed : bool" Usage="System.Windows.Forms.DataGridViewCell.Displayed" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the cell is currently displayed on-screen.</summary>
<value>
<see langword="true" /> if the cell is on-screen or partially on-screen; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this property to determine whether a particular cell has been scrolled off-screen.
If the cell's <xref:System.Windows.Forms.DataGridViewCell.Visible%2A> property value is `false`, this property will return `false` as well.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Visible" />
</Docs>
</Member>
<MemberGroup MemberName="Dispose">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Releases the resources used by the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Dispose();" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -&gt; unit&#xA;override this.Dispose : unit -&gt; unit" Usage="dataGridViewCell.Dispose " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.DataGridViewCell>. The <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A> method leaves the <xref:System.Windows.Forms.DataGridViewCell> in an unusable state. After calling <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.DataGridViewCell> so the garbage collector can reclaim the memory that the <xref:System.Windows.Forms.DataGridViewCell> was occupying. For more information, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
> [!NOTE]
> Always call <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A> before you release your last reference to the <xref:System.Windows.Forms.DataGridViewCell>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Windows.Forms.DataGridViewCell> object's `Finalize` method.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -&gt; unit&#xA;override this.Dispose : bool -&gt; unit" Usage="dataGridViewCell.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.DataGridViewCell" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public `Dispose` method and the <xref:System.Object.Finalize%2A> method. `Dispose` invokes the protected `Dispose(Boolean)` method with the `disposing` parameter set to `true`. <xref:System.Object.Finalize%2A> invokes `Dispose` with `disposing` set to `false`.
When the `disposing` parameter is `true`, this method releases all resources held by any managed objects that this <xref:System.Windows.Forms.DataGridViewCell> references. This method invokes the `Dispose` method of each referenced object.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>
<see langword="Dispose" /> can be called multiple times by other objects. When overriding <see langword="Dispose(Boolean)" /> be careful not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and [Overriding the Finalize Method](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)).</para>
</block>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="DoubleClickUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool DoubleClickUnsharesRow (System.Windows.Forms.DataGridViewCellEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool DoubleClickUnsharesRow(class System.Windows.Forms.DataGridViewCellEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.DoubleClickUnsharesRow(System.Windows.Forms.DataGridViewCellEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function DoubleClickUnsharesRow (e As DataGridViewCellEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool DoubleClickUnsharesRow(System::Windows::Forms::DataGridViewCellEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member DoubleClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool&#xA;override this.DoubleClickUnsharesRow : System.Windows.Forms.DataGridViewCellEventArgs -&gt; bool" Usage="dataGridViewCell.DoubleClickUnsharesRow e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.DataGridViewCellEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> containing the data passed to the <see cref="M:System.Windows.Forms.DataGridViewCell.OnDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method.</param>
<summary>Indicates whether the cell's row will be unshared when the cell is double-clicked.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.DoubleClickUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnDoubleClick%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnDoubleClick%2A> has the effect of unsharing the cell's row. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="EditedFormattedValue">
<MemberSignature Language="C#" Value="public object EditedFormattedValue { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object EditedFormattedValue" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.EditedFormattedValue" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EditedFormattedValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ EditedFormattedValue { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EditedFormattedValue : obj" Usage="System.Windows.Forms.DataGridViewCell.EditedFormattedValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current, formatted value of the cell, regardless of whether the cell is in edit mode and the value has not been committed.</summary>
<value>The current, formatted value of the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property returns the current value of the cell or editing control if the cell is in edit mode. Otherwise, getting the value of this property converts the cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. This raises the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event, which you can handle to customize the value conversion.
If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError?displayProperty=nameWithType> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.EditedFormattedValue%2A> property. In this example, the <xref:System.Windows.Forms.DataGridView.IsCurrentCellDirty%2A> property is used to determine if the current cell's contents have been edited and not committed and, if the cell has been modified, the edited value is used. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event.
[!code-csharp[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/CS/form1.cs#10)]
[!code-vb[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb#10)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The row containing the cell is a shared row.
-or-
The cell is a column header cell.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.Exception">Formatting failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event of the <see cref="T:System.Windows.Forms.DataGridView" /> control or the handler set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="EditType">
<MemberSignature Language="C#" Value="public virtual Type EditType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type EditType" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.EditType" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property EditType As Type" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property Type ^ EditType { Type ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EditType : Type" Usage="System.Windows.Forms.DataGridViewCell.EditType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of the cell's hosted editing control.</summary>
<value>A <see cref="T:System.Type" /> representing the <see cref="T:System.Windows.Forms.DataGridViewTextBoxEditingControl" /> type.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A derived cell type overrides this property to return the type of its hosted editing control. If the cell does not have an editing control, as with <xref:System.Windows.Forms.DataGridViewButtonCell>, the <xref:System.Windows.Forms.DataGridViewCell.EditType%2A> property returns `null`.
## Examples
The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.EditType%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](~/docs/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells.md).
[!code-csharp[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/CS/datagridviewcalendarcolumn.cs#200)]
[!code-vb[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb#200)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.IDataGridViewEditingControl" />
<altmember cref="T:System.Windows.Forms.DataGridViewButtonCell" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValueType" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.EditType" />
</Docs>
</Member>
<Member MemberName="EnterUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool EnterUnsharesRow (int rowIndex, bool throughMouseClick);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool EnterUnsharesRow(int32 rowIndex, bool throughMouseClick) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.EnterUnsharesRow(System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function EnterUnsharesRow (rowIndex As Integer, throughMouseClick As Boolean) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool EnterUnsharesRow(int rowIndex, bool throughMouseClick);" />
<MemberSignature Language="F#" Value="abstract member EnterUnsharesRow : int * bool -&gt; bool&#xA;override this.EnterUnsharesRow : int * bool -&gt; bool" Usage="dataGridViewCell.EnterUnsharesRow (rowIndex, throughMouseClick)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="throughMouseClick" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the cell's parent row.</param>
<param name="throughMouseClick">
<see langword="true" /> if a user action moved focus to the cell; <see langword="false" /> if a programmatic operation moved focus to the cell.</param>
<summary>Indicates whether the parent row will be unshared when the focus moves to the cell.</summary>
<returns>
<see langword="true" /> if the row will be unshared; otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.EnterUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnEnter%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnEnter%2A> has the effect of unsharing the row containing the cell. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnEnter(System.Int32,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnLeave(System.Int32,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseEnterUnsharesRow(System.Int32)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="ErrorIconBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle ErrorIconBounds { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Rectangle ErrorIconBounds" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.ErrorIconBounds" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ErrorIconBounds As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Rectangle ErrorIconBounds { System::Drawing::Rectangle get(); };" />
<MemberSignature Language="F#" Value="member this.ErrorIconBounds : System.Drawing.Rectangle" Usage="System.Windows.Forms.DataGridViewCell.ErrorIconBounds" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the bounds of the error icon for the cell.</summary>
<value>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the error icon for the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The returned rectangle reports client coordinates, in pixels.
When the <xref:System.Windows.Forms.DataGridView.ShowCellErrors%2A?displayProperty=nameWithType> property is `false`, the value of this property is <xref:System.Drawing.Rectangle.Empty>.
This property calls the <xref:System.Windows.Forms.DataGridViewCell.GetErrorIconBounds%2A> method to get its value. For the base <xref:System.Windows.Forms.DataGridViewCell> type, this value is always <xref:System.Drawing.Rectangle.Empty>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The cell does not belong to a <see cref="T:System.Windows.Forms.DataGridView" /> control.
-or-
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The row containing the cell is a shared row.
-or-
The cell is a column header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetErrorIconBounds(System.Drawing.Graphics,System.Windows.Forms.DataGridViewCellStyle,System.Int32)" />
<altmember cref="T:System.Drawing.Rectangle" />
</Docs>
</Member>
<Member MemberName="ErrorText">
<MemberSignature Language="C#" Value="public string ErrorText { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ErrorText" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.ErrorText" />
<MemberSignature Language="VB.NET" Value="Public Property ErrorText As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ErrorText { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ErrorText : string with get, set" Usage="System.Windows.Forms.DataGridViewCell.ErrorText" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text describing an error condition associated with the cell.</summary>
<value>The text that describes an error condition associated with the cell.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Typically, the <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A> property is used when handling the <xref:System.Windows.Forms.DataGridView.CellValidating> event of the <xref:System.Windows.Forms.DataGridView>. If the cell's value fails some validation criteria, set the <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A> property and cancel the commit operation by setting the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property of the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs> to `true`. The text you specify is then displayed by the <xref:System.Windows.Forms.DataGridView>, and the user is prompted to fix the error in the cell's data.
When the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property of the <xref:System.Windows.Forms.DataGridView> is `true`, you can provide error text for rows and cells using the <xref:System.Windows.Forms.DataGridView.RowErrorTextNeeded> and <xref:System.Windows.Forms.DataGridView.CellErrorTextNeeded> events.
When you assign a different <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A> string to a cell, the <xref:System.Windows.Forms.DataGridView.CellErrorTextChanged> event of the <xref:System.Windows.Forms.DataGridView> control is raised.
Starting with the .NET Framework 4.5.2, resizing of the error icon is determined by the system DPI setting when the app.config file contains the following entry:
```
<appSettings>
  <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>
```
## Examples
The following code example demonstrates how to use this property when handling error conditions in an unbound <xref:System.Windows.Forms.DataGridView>. The `AnnotateCell` method sets an error message string to the <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A> property.
[!code-cpp[System.Windows.Forms.GridViewUnbound#9](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp#9)]
[!code-csharp[System.Windows.Forms.GridViewUnbound#9](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CS/form1.cs#9)]
[!code-vb[System.Windows.Forms.GridViewUnbound#9](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb#9)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataGridViewCellValidatingEventArgs" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellValidating" />
<altmember cref="P:System.Windows.Forms.DataGridView.VirtualMode" />
<altmember cref="E:System.Windows.Forms.DataGridView.RowErrorTextNeeded" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellErrorTextNeeded" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellErrorTextChanged" />
<altmember cref="P:System.ComponentModel.CancelEventArgs.Cancel" />
</Docs>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="~DataGridViewCell ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.Finalize" />
<MemberSignature Language="VB.NET" Value="Finalize ()" />
<MemberSignature Language="C++ CLI" Value="!DataGridViewCell ()" />
<MemberSignature Language="F#" Value="override this.Finalize : unit -&gt; unit" Usage="dataGridViewCell.Finalize " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases the unmanaged resources and performs other cleanup operations before the <see cref="T:System.Windows.Forms.DataGridViewCell" /> is reclaimed by garbage collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method calls the <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A> method with `false` as a parameter.
This method overrides <xref:System.Object.Finalize%2A>. Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the <xref:System.GC.SuppressFinalize%2A> method.
For more information, see [Finalize Methods and Destructors](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md), and [Overriding the Finalize Method](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="FormattedValue">
<MemberSignature Language="C#" Value="public object FormattedValue { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object FormattedValue" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.FormattedValue" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property FormattedValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ FormattedValue { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FormattedValue : obj" Usage="System.Windows.Forms.DataGridViewCell.FormattedValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the value of the cell as formatted for display.</summary>
<value>The formatted value of the cell or <see langword="null" /> if the cell does not belong to a <see cref="T:System.Windows.Forms.DataGridView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property is the actual data object contained by the cell, whereas the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> is the formatted representation of this object. The <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> and <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> properties correspond to the data types of these values, respectively.
Getting the value of this property calls the <xref:System.Windows.Forms.DataGridViewCell.GetFormattedValue%2A> method to convert the cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. This raises the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event, which you can handle to customize the value conversion.
If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError?displayProperty=nameWithType> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> property. In this example, the <xref:System.Windows.Forms.DataGridView.IsCurrentCellDirty%2A> property is used to determine if the current cell's contents have been edited and not committed and, if the cell has been modified, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> is used. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event.
[!code-csharp[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/CS/form1.cs#10)]
[!code-vb[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb#10)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The row containing the cell is a shared row.
-or-
The cell is a column header cell.</exception>
<exception cref="T:System.Exception">Formatting failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event of the <see cref="T:System.Windows.Forms.DataGridView" /> control or the handler set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValueType" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.ValueType" />
<altmember cref="T:System.Windows.Forms.IDataGridViewEditingControl" />
</Docs>
</Member>
<Member MemberName="FormattedValueType">
<MemberSignature Language="C#" Value="public virtual Type FormattedValueType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type FormattedValueType" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.FormattedValueType" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property FormattedValueType As Type" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property Type ^ FormattedValueType { Type ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FormattedValueType : Type" Usage="System.Windows.Forms.DataGridViewCell.FormattedValueType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of the formatted value associated with the cell.</summary>
<value>A <see cref="T:System.Type" /> representing the type of the cell's formatted value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property is the actual data object contained by the cell, whereas the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> property is the formatted representation of the data. The <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> and <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> properties correspond to the data types of these values, respectively.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property to determine the type of the cell contents. In this example, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property is used to determine whether the cell contains a <xref:System.String> before attempting to convert the value. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event.
[!code-csharp[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/CS/form1.cs#10)]
[!code-vb[System.Windows.Forms.DataGridViewSelectionSum#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb#10)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValue" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.ValueType" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" />
</Docs>
</Member>
<Member MemberName="Frozen">
<MemberSignature Language="C#" Value="public virtual bool Frozen { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Frozen" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.Frozen" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Frozen As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool Frozen { bool get(); };" />
<MemberSignature Language="F#" Value="member this.Frozen : bool" Usage="System.Windows.Forms.DataGridViewCell.Frozen" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the cell is frozen.</summary>
<value>
<see langword="true" /> if the cell is frozen; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of the <xref:System.Windows.Forms.DataGridViewCell.Frozen%2A> property depends on the state of the cell's parent row and column. If the `Frozen` property of either the row or column is set to `true`, the cell's <xref:System.Windows.Forms.DataGridViewCell.Frozen%2A> property will also be `true`.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataGridViewElementStates" />
<altmember cref="P:System.Windows.Forms.DataGridViewRow.Frozen" />
<altmember cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" />
</Docs>
</Member>
<Member MemberName="GetClipboardContent">
<MemberSignature Language="C#" Value="protected virtual object GetClipboardContent (int rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, string format);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance object GetClipboardContent(int32 rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, string format) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetClipboardContent(System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetClipboardContent (rowIndex As Integer, firstCell As Boolean, lastCell As Boolean, inFirstRow As Boolean, inLastRow As Boolean, format As String) As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Object ^ GetClipboardContent(int rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, System::String ^ format);" />
<MemberSignature Language="F#" Value="abstract member GetClipboardContent : int * bool * bool * bool * bool * string -&gt; obj&#xA;override this.GetClipboardContent : int * bool * bool * bool * bool * string -&gt; obj" Usage="dataGridViewCell.GetClipboardContent (rowIndex, firstCell, lastCell, inFirstRow, inLastRow, format)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="firstCell" Type="System.Boolean" />
<Parameter Name="lastCell" Type="System.Boolean" />
<Parameter Name="inFirstRow" Type="System.Boolean" />
<Parameter Name="inLastRow" Type="System.Boolean" />
<Parameter Name="format" Type="System.String" />
</Parameters>
<Docs>
<param name="rowIndex">The zero-based index of the row containing the cell.</param>
<param name="firstCell">
<see langword="true" /> to indicate that the cell is in the first column of the region defined by the selected cells; otherwise, <see langword="false" />.</param>
<param name="lastCell">
<see langword="true" /> to indicate that the cell is the last column of the region defined by the selected cells; otherwise, <see langword="false" />.</param>
<param name="inFirstRow">
<see langword="true" /> to indicate that the cell is in the first row of the region defined by the selected cells; otherwise, <see langword="false" />.</param>
<param name="inLastRow">
<see langword="true" /> to indicate that the cell is in the last row of the region defined by the selected cells; otherwise, <see langword="false" />.</param>
<param name="format">The current format string of the cell.</param>
<summary>Retrieves the formatted value of the cell to copy to the <see cref="T:System.Windows.Forms.Clipboard" />.</summary>
<returns>An <see cref="T:System.Object" /> that represents the value of the cell to copy to the <see cref="T:System.Windows.Forms.Clipboard" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the <xref:System.Windows.Forms.DataGridView.GetClipboardContent%2A?displayProperty=nameWithType> method to retrieve a Clipboard-formatted value that represents the cell value.
The cell value is first retrieved in its display format from the <xref:System.Windows.Forms.DataGridViewCell.GetEditedFormattedValue%2A> method. This may raise the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to format the value and the <xref:System.Windows.Forms.DataGridView.DataError?displayProperty=nameWithType> event if formatting is unsuccessful.
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 <xref:System.Windows.Forms.DataGridView> control. Depending on the cell's position, additional formatting information may be returned by this method along with the display-formatted 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 <xref:System.Windows.Forms.DataFormats.Text?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.UnicodeText?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.Html?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataFormats.CommaSeparatedValue?displayProperty=nameWithType>.
For more information, see the <xref:System.Windows.Forms.Clipboard> class.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="rowIndex" /> is less than 0 or greater than or equal to the number of rows in the control.</exception>
<exception cref="T:System.InvalidOperationException">The value of the cell's <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property is <see langword="null" />.
-or-
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.Exception">Formatting failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event of the <see cref="T:System.Windows.Forms.DataGridView" /> control or the handler set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception>
<block subset="none" type="overrides">
<para>Override this method to provide customized Clipboard values. For example, you could override this method to support copying values from custom cell types.</para>
</block>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataFormats" />
<altmember cref="P:System.Windows.Forms.DataGridView.ClipboardCopyMode" />
<altmember cref="T:System.Windows.Forms.DataGridViewClipboardCopyMode" />
</Docs>
</Member>
<MemberGroup MemberName="GetContentBounds">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns the bounding rectangle that encloses the cell's content area.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetContentBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetContentBounds (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetContentBounds(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetContentBounds(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function GetContentBounds (rowIndex As Integer) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetContentBounds(int rowIndex);" />
<MemberSignature Language="F#" Value="member this.GetContentBounds : int -&gt; System.Drawing.Rectangle" Usage="dataGridViewCell.GetContentBounds rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Returns the bounding rectangle that encloses the cell's content area using a default <see cref="T:System.Drawing.Graphics" /> and cell style currently in effect for the cell.</summary>
<returns>The <see cref="T:System.Drawing.Rectangle" /> that bounds the cell's contents.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The size of the cell's contents is computed dynamically when this method is called. The base class implementation always returns <xref:System.Drawing.Rectangle.Empty?displayProperty=nameWithType>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified <paramref name="rowIndex" /> is less than 0 or greater than the number of rows in the control minus 1.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="GetContentBounds">
<MemberSignature Language="C#" Value="protected virtual System.Drawing.Rectangle GetContentBounds (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance valuetype System.Drawing.Rectangle GetContentBounds(class System.Drawing.Graphics graphics, class System.Windows.Forms.DataGridViewCellStyle cellStyle, int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetContentBounds(System.Drawing.Graphics,System.Windows.Forms.DataGridViewCellStyle,System.Int32)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Drawing::Rectangle GetContentBounds(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetContentBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -&gt; System.Drawing.Rectangle&#xA;override this.GetContentBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -&gt; System.Drawing.Rectangle" Usage="dataGridViewCell.GetContentBounds (graphics, cellStyle, rowIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="cellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" />
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="graphics">The graphics context for the cell.</param>
<param name="cellStyle">The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be applied to the cell.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified <see cref="T:System.Drawing.Graphics" /> and cell style.</summary>
<returns>The <see cref="T:System.Drawing.Rectangle" /> that bounds the cell's contents.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The size of the cell's contents is computed dynamically when this method is called. The base class implementation always returns <xref:System.Drawing.Rectangle.Empty?displayProperty=nameWithType>.
This method is called internally when the <xref:System.Windows.Forms.DataGridViewCell.ContentBounds%2A> property is read.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.ContentBounds" />
</Docs>
</Member>
<Member MemberName="GetEditedFormattedValue">
<MemberSignature Language="C#" Value="public object GetEditedFormattedValue (int rowIndex, System.Windows.Forms.DataGridViewDataErrorContexts context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance object GetEditedFormattedValue(int32 rowIndex, valuetype System.Windows.Forms.DataGridViewDataErrorContexts context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetEditedFormattedValue(System.Int32,System.Windows.Forms.DataGridViewDataErrorContexts)" />
<MemberSignature Language="VB.NET" Value="Public Function GetEditedFormattedValue (rowIndex As Integer, context As DataGridViewDataErrorContexts) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Object ^ GetEditedFormattedValue(int rowIndex, System::Windows::Forms::DataGridViewDataErrorContexts context);" />
<MemberSignature Language="F#" Value="member this.GetEditedFormattedValue : int * System.Windows.Forms.DataGridViewDataErrorContexts -&gt; obj" Usage="dataGridViewCell.GetEditedFormattedValue (rowIndex, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="context" Type="System.Windows.Forms.DataGridViewDataErrorContexts" />
</Parameters>
<Docs>
<param name="rowIndex">The row index of the cell.</param>
<param name="context">A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewDataErrorContexts" /> values that specifies the data error context.</param>
<summary>Returns the current, formatted value of the cell, regardless of whether the cell is in edit mode and the value has not been committed.</summary>
<returns>The current, formatted value of the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method returns the current value of the editing cell or editing control if the cell is in edit mode. Otherwise, this method converts the cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. This raises the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event, which you can handle to customize the value conversion.
If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError?displayProperty=nameWithType> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown.
Derived classes that override this method will typically return a string representation of the cell value if the `context` argument includes the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.ClipboardContent> value.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified <paramref name="rowIndex" /> is less than 0 or greater than the number of rows in the control minus 1.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.Exception">Formatting failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event of the <see cref="T:System.Windows.Forms.DataGridView" /> control or the handler set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellFormatting" />
</Docs>
</Member>
<Member MemberName="GetErrorIconBounds">
<MemberSignature Language="C#" Value="protected virtual System.Drawing.Rectangle GetErrorIconBounds (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance valuetype System.Drawing.Rectangle GetErrorIconBounds(class System.Drawing.Graphics graphics, class System.Windows.Forms.DataGridViewCellStyle cellStyle, int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetErrorIconBounds(System.Drawing.Graphics,System.Windows.Forms.DataGridViewCellStyle,System.Int32)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Drawing::Rectangle GetErrorIconBounds(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetErrorIconBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -&gt; System.Drawing.Rectangle&#xA;override this.GetErrorIconBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -&gt; System.Drawing.Rectangle" Usage="dataGridViewCell.GetErrorIconBounds (graphics, cellStyle, rowIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="cellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" />
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="graphics">The graphics context for the cell.</param>
<param name="cellStyle">The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be applied to the cell.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Returns the bounding rectangle that encloses the cell's error icon, if one is displayed.</summary>
<returns>The <see cref="T:System.Drawing.Rectangle" /> that bounds the cell's error icon, if one is displayed; otherwise, <see cref="F:System.Drawing.Rectangle.Empty" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The size of the cell's error icon area is computed dynamically when this method is called. The base class implementation always returns <xref:System.Drawing.Rectangle.Empty?displayProperty=nameWithType>.
This method is called internally when the <xref:System.Windows.Forms.DataGridViewCell.ErrorIconBounds%2A> property is read.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.ErrorIconBounds" />
</Docs>
</Member>
<Member MemberName="GetErrorText">
<MemberSignature Language="C#" Value="protected internal virtual string GetErrorText (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance string GetErrorText(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetErrorText(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Function GetErrorText (rowIndex As Integer) As String" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual System::String ^ GetErrorText(int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetErrorText : int -&gt; string&#xA;override this.GetErrorText : int -&gt; string" Usage="dataGridViewCell.GetErrorText rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The row index of the cell.</param>
<summary>Returns a string that represents the error for the cell.</summary>
<returns>A string that describes the error for the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</returns>
<remarks>To be added.</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="GetFormattedValue">
<MemberSignature Language="C#" Value="protected virtual object GetFormattedValue (object value, int rowIndex, ref System.Windows.Forms.DataGridViewCellStyle cellStyle, System.ComponentModel.TypeConverter valueTypeConverter, System.ComponentModel.TypeConverter formattedValueTypeConverter, System.Windows.Forms.DataGridViewDataErrorContexts context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance object GetFormattedValue(object value, int32 rowIndex, class System.Windows.Forms.DataGridViewCellStyle&amp; cellStyle, class System.ComponentModel.TypeConverter valueTypeConverter, class System.ComponentModel.TypeConverter formattedValueTypeConverter, valuetype System.Windows.Forms.DataGridViewDataErrorContexts context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetFormattedValue(System.Object,System.Int32,System.Windows.Forms.DataGridViewCellStyle@,System.ComponentModel.TypeConverter,System.ComponentModel.TypeConverter,System.Windows.Forms.DataGridViewDataErrorContexts)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetFormattedValue (value As Object, rowIndex As Integer, ByRef cellStyle As DataGridViewCellStyle, valueTypeConverter As TypeConverter, formattedValueTypeConverter As TypeConverter, context As DataGridViewDataErrorContexts) As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Object ^ GetFormattedValue(System::Object ^ value, int rowIndex, System::Windows::Forms::DataGridViewCellStyle ^ % cellStyle, System::ComponentModel::TypeConverter ^ valueTypeConverter, System::ComponentModel::TypeConverter ^ formattedValueTypeConverter, System::Windows::Forms::DataGridViewDataErrorContexts context);" />
<MemberSignature Language="F#" Value="abstract member GetFormattedValue : obj * int * DataGridViewCellStyle * System.ComponentModel.TypeConverter * System.ComponentModel.TypeConverter * System.Windows.Forms.DataGridViewDataErrorContexts -&gt; obj&#xA;override this.GetFormattedValue : obj * int * DataGridViewCellStyle * System.ComponentModel.TypeConverter * System.ComponentModel.TypeConverter * System.Windows.Forms.DataGridViewDataErrorContexts -&gt; obj" Usage="dataGridViewCell.GetFormattedValue (value, rowIndex, cellStyle, valueTypeConverter, formattedValueTypeConverter, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="cellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" RefType="ref" />
<Parameter Name="valueTypeConverter" Type="System.ComponentModel.TypeConverter" />
<Parameter Name="formattedValueTypeConverter" Type="System.ComponentModel.TypeConverter" />
<Parameter Name="context" Type="System.Windows.Forms.DataGridViewDataErrorContexts" />
</Parameters>
<Docs>
<param name="value">The value to be formatted.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<param name="cellStyle">The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> in effect for the cell.</param>
<param name="valueTypeConverter">A <see cref="T:System.ComponentModel.TypeConverter" /> associated with the value type that provides custom conversion to the formatted value type, or <see langword="null" /> if no such custom conversion is needed.</param>
<param name="formattedValueTypeConverter">A <see cref="T:System.ComponentModel.TypeConverter" /> associated with the formatted value type that provides custom conversion from the value type, or <see langword="null" /> if no such custom conversion is needed.</param>
<param name="context">A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewDataErrorContexts" /> values describing the context in which the formatted value is needed.</param>
<summary>Gets the value of the cell as formatted for display.</summary>
<returns>The formatted value of the cell or <see langword="null" /> if the cell does not belong to a <see cref="T:System.Windows.Forms.DataGridView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridView> control calls this method to convert a cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. The control passes the cell value to this method in the `value` parameter.
This method raises the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event. A handler for this event can modify both the `value` and `cellStyle` parameters. If the handler does not set the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A?displayProperty=nameWithType> property to `true`, however, this method formats `value` using the formatting properties of the `cellStyle` object.
> [!NOTE]
> This method does not convert `value` to the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A?displayProperty=nameWithType> property value for values equal to the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A?displayProperty=nameWithType> property value when <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is set to a value other than <xref:System.DBNull.Value?displayProperty=nameWithType> or `null`. In this case, you can handle the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. For more information, see the code example in <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A>.
If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown.
Derived classes that override this method will typically return a string representation of the cell value if the `context` argument includes the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.ClipboardContent> value.
]]></format>
</remarks>
<exception cref="T:System.Exception">Formatting failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event of the <see cref="T:System.Windows.Forms.DataGridView" /> control or the handler set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception>
<altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValueType" />
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellFormatting" />
<altmember cref="E:System.Windows.Forms.DataGridView.DataError" />
<altmember cref="P:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied" />
<altmember cref="T:System.ComponentModel.TypeConverter" />
<altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.Format" />
<altmember cref="T:System.Windows.Forms.DataGridViewDataErrorContexts" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.ParseFormattedValue(System.Object,System.Windows.Forms.DataGridViewCellStyle,System.ComponentModel.TypeConverter,System.ComponentModel.TypeConverter)" />
</Docs>
</Member>
<Member MemberName="GetInheritedContextMenuStrip">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.ContextMenuStrip GetInheritedContextMenuStrip (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Windows.Forms.ContextMenuStrip GetInheritedContextMenuStrip(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetInheritedContextMenuStrip(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetInheritedContextMenuStrip (rowIndex As Integer) As ContextMenuStrip" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Windows::Forms::ContextMenuStrip ^ GetInheritedContextMenuStrip(int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetInheritedContextMenuStrip : int -&gt; System.Windows.Forms.ContextMenuStrip&#xA;override this.GetInheritedContextMenuStrip : int -&gt; System.Windows.Forms.ContextMenuStrip" Usage="dataGridViewCell.GetInheritedContextMenuStrip rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ContextMenuStrip</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The row index of the current cell.</param>
<summary>Gets the inherited shortcut menu for the current cell.</summary>
<returns>A <see cref="T:System.Windows.Forms.ContextMenuStrip" /> if the parent <see cref="T:System.Windows.Forms.DataGridView" />, <see cref="T:System.Windows.Forms.DataGridViewRow" />, or <see cref="T:System.Windows.Forms.DataGridViewColumn" /> has a <see cref="T:System.Windows.Forms.ContextMenuStrip" /> assigned; otherwise, <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the cell does not have an associated <xref:System.Windows.Forms.ContextMenuStrip>, it will inherit one from its parents, using the following precedence:
1. This cell's <xref:System.Windows.Forms.DataGridViewCell.ContextMenuStrip%2A>
2. The owning row's <xref:System.Windows.Forms.DataGridViewRow.ContextMenuStrip%2A?displayProperty=nameWithType>
3. The owning column's <xref:System.Windows.Forms.DataGridViewColumn.ContextMenuStrip%2A?displayProperty=nameWithType>
4. The parent table's <xref:System.Windows.Forms.ContextMenuStrip?displayProperty=nameWithType>
Shortcut menus are Microsoft Windows native resources whose lifetimes are typically directed by the <xref:System.Windows.Forms.DataGridViewCell.Dispose%2A> method or the destructor.
Pass the <xref:System.Windows.Forms.DataGridViewCell.GetInheritedContextMenuStrip%2A> method the row index you used to retrieve the <xref:System.Windows.Forms.DataGridViewCell>. Do not use the <xref:System.Windows.Forms.DataGridViewCell.RowIndex%2A> property for the `rowIndex` parameter. If the row is shared, <xref:System.Windows.Forms.DataGridViewCell.RowIndex%2A> is -1, which is not a valid value for `rowIndex`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value of the <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property of the cell is not <see langword="null" /> and the specified <paramref name="rowIndex" /> is less than 0 or greater than the number of rows in the control minus 1.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.ContextMenuStrip" />
<altmember cref="P:System.Windows.Forms.Control.ContextMenuStrip" />
<altmember cref="T:System.Windows.Forms.ContextMenuStrip" />
<altmember cref="T:System.Windows.Forms.DataGridViewRow" />
<altmember cref="T:System.Windows.Forms.DataGridViewColumn" />
</Docs>
</Member>
<Member MemberName="GetInheritedState">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.DataGridViewElementStates GetInheritedState (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype System.Windows.Forms.DataGridViewElementStates GetInheritedState(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetInheritedState(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetInheritedState (rowIndex As Integer) As DataGridViewElementStates" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Windows::Forms::DataGridViewElementStates GetInheritedState(int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetInheritedState : int -&gt; System.Windows.Forms.DataGridViewElementStates&#xA;override this.GetInheritedState : int -&gt; System.Windows.Forms.DataGridViewElementStates" Usage="dataGridViewCell.GetInheritedState rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridViewElementStates</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the row containing the cell.</param>
<summary>Returns a value indicating the current state of the cell as inherited from the state of its row and column.</summary>
<returns>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values representing the current state of the cell.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is useful to determine the state of a cell in a shared row. Shared rows have <xref:System.Windows.Forms.DataGridViewBand.Index%2A> values of -1, which prevents you from using the <xref:System.Windows.Forms.DataGridViewCell.InheritedState%2A> property with cells in shared rows. To use this method, pass in the actual index of the row containing this cell. You can retrieve the actual index of a shared row by calling the <xref:System.Windows.Forms.DataGridViewRowCollection.IndexOf%2A> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The cell is not contained within a <see cref="T:System.Windows.Forms.DataGridView" /> control and <paramref name="rowIndex" /> is not -1.
-or-
<paramref name="rowIndex" /> is not the index of the row containing this cell.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The cell is contained within a <see cref="T:System.Windows.Forms.DataGridView" /> control and <paramref name="rowIndex" /> is outside the valid range of 0 to the number of rows in the control minus 1.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="GetInheritedStyle">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle (System.Windows.Forms.DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle(class System.Windows.Forms.DataGridViewCellStyle inheritedCellStyle, int32 rowIndex, bool includeColors) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle,System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetInheritedStyle (inheritedCellStyle As DataGridViewCellStyle, rowIndex As Integer, includeColors As Boolean) As DataGridViewCellStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Windows::Forms::DataGridViewCellStyle ^ GetInheritedStyle(System::Windows::Forms::DataGridViewCellStyle ^ inheritedCellStyle, int rowIndex, bool includeColors);" />
<MemberSignature Language="F#" Value="abstract member GetInheritedStyle : System.Windows.Forms.DataGridViewCellStyle * int * bool -&gt; System.Windows.Forms.DataGridViewCellStyle&#xA;override this.GetInheritedStyle : System.Windows.Forms.DataGridViewCellStyle * int * bool -&gt; System.Windows.Forms.DataGridViewCellStyle" Usage="dataGridViewCell.GetInheritedStyle (inheritedCellStyle, rowIndex, includeColors)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridViewCellStyle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="inheritedCellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" />
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="includeColors" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="inheritedCellStyle">A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be populated with the inherited cell style.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<param name="includeColors">
<see langword="true" /> to include inherited colors in the returned cell style; otherwise, <see langword="false" />.</param>
<summary>Gets the style applied to the cell.</summary>
<returns>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that includes the style settings of the cell inherited from the cell's parent row, column, and <see cref="T:System.Windows.Forms.DataGridView" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method returns a <xref:System.Windows.Forms.DataGridViewCellStyle> that inherits its settings from the <xref:System.Windows.Forms.DataGridViewCellStyle> objects of the cell's parent row, column, and <xref:System.Windows.Forms.DataGridView>. For more information, see [Cell Styles in the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The cell has no associated <see cref="T:System.Windows.Forms.DataGridView" />.
-or-
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="rowIndex" /> is less than 0, or greater than or equal to the number of rows in the parent <see cref="T:System.Windows.Forms.DataGridView" />.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle(System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Boolean,System.Boolean,System.Boolean,System.Boolean)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.HasStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" />
</Docs>
</Member>
<Member MemberName="GetPreferredSize">
<MemberSignature Language="C#" Value="protected virtual System.Drawing.Size GetPreferredSize (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex, System.Drawing.Size constraintSize);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance valuetype System.Drawing.Size GetPreferredSize(class System.Drawing.Graphics graphics, class System.Windows.Forms.DataGridViewCellStyle cellStyle, int32 rowIndex, valuetype System.Drawing.Size constraintSize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetPreferredSize(System.Drawing.Graphics,System.Windows.Forms.DataGridViewCellStyle,System.Int32,System.Drawing.Size)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Drawing::Size GetPreferredSize(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex, System::Drawing::Size constraintSize);" />
<MemberSignature Language="F#" Value="abstract member GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -&gt; System.Drawing.Size&#xA;override this.GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -&gt; System.Drawing.Size" Usage="dataGridViewCell.GetPreferredSize (graphics, cellStyle, rowIndex, constraintSize)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="cellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" />
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="constraintSize" Type="System.Drawing.Size" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to draw the cell.</param>
<param name="cellStyle">A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents the style of the cell.</param>
<param name="rowIndex">The zero-based row index of the cell.</param>
<param name="constraintSize">The cell's maximum allowable size.</param>
<summary>Calculates the preferred size, in pixels, of the cell.</summary>
<returns>A <see cref="T:System.Drawing.Size" /> that represents the preferred size, in pixels, of the cell.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.GetPreferredSize%2A> method in the base class <xref:System.Windows.Forms.DataGridViewCell> always returns a <xref:System.Drawing.Size> with a width and height of -1. However, this method is overridden in the derived cell classes to return proper values.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="GetSize">
<MemberSignature Language="C#" Value="protected virtual System.Drawing.Size GetSize (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance valuetype System.Drawing.Size GetSize(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetSize(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetSize (rowIndex As Integer) As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Drawing::Size GetSize(int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetSize : int -&gt; System.Drawing.Size&#xA;override this.GetSize : int -&gt; System.Drawing.Size" Usage="dataGridViewCell.GetSize rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Gets the size of the cell.</summary>
<returns>A <see cref="T:System.Drawing.Size" /> representing the cell's dimensions.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method cannot be used with a cell in a shared row.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="rowIndex" /> is -1</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="GetValue">
<MemberSignature Language="C#" Value="protected virtual object GetValue (int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance object GetValue(int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.GetValue(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetValue (rowIndex As Integer) As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Object ^ GetValue(int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member GetValue : int -&gt; obj&#xA;override this.GetValue : int -&gt; obj" Usage="dataGridViewCell.GetValue rowIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Gets the value of the cell.</summary>
<returns>The value contained in the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Pass the <xref:System.Windows.Forms.DataGridViewCell.GetValue%2A> method the row index you used to retrieve the <xref:System.Windows.Forms.DataGridViewCell>. Do not use the <xref:System.Windows.Forms.DataGridViewCell.RowIndex%2A> property for the `rowIndex` parameter. If the row is shared, <xref:System.Windows.Forms.DataGridViewCell.RowIndex%2A> is -1, which is not a valid value for `rowIndex`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value of the <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property of the cell is not <see langword="null" /> and <paramref name="rowIndex" /> is less than 0 or greater than or equal to the number of rows in the parent <see cref="T:System.Windows.Forms.DataGridView" />.</exception>
<exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property of the cell is not <see langword="null" /> and the value of the <see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> property is less than 0, indicating that the cell is a row header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="HasStyle">
<MemberSignature Language="C#" Value="public bool HasStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HasStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.HasStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property HasStyle As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HasStyle { bool get(); };" />
<MemberSignature Language="F#" Value="member this.HasStyle : bool" Usage="System.Windows.Forms.DataGridViewCell.HasStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the <see cref="P:System.Windows.Forms.DataGridViewCell.Style" /> property has been set.</summary>
<value>
<see langword="true" /> if the <see cref="P:System.Windows.Forms.DataGridViewCell.Style" /> property has been set; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Getting the value of the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property automatically instantiates a new <xref:System.Windows.Forms.DataGridViewCellStyle> if the property has not previously been accessed. Therefore, you must use the <xref:System.Windows.Forms.DataGridViewCell.HasStyle%2A> property to determine whether the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property is currently set to a <xref:System.Windows.Forms.DataGridViewCellStyle> instance. This is useful to determine which properties of the object returned by the <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property represent styles set specifically for the cell.
For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" />
<altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewRow.DefaultCellStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle(System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Boolean,System.Boolean,System.Boolean,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle,System.Int32,System.Boolean)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" />
</Docs>
</Member>
<Member MemberName="InheritedState">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGridViewElementStates InheritedState { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.DataGridViewElementStates InheritedState" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.InheritedState" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property InheritedState As DataGridViewElementStates" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::DataGridViewElementStates InheritedState { System::Windows::Forms::DataGridViewElementStates get(); };" />
<MemberSignature Language="F#" Value="member this.InheritedState : System.Windows.Forms.DataGridViewElementStates" Usage="System.Windows.Forms.DataGridViewCell.InheritedState" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridViewElementStates</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current state of the cell as inherited from the state of its row and column.</summary>
<value>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values representing the current state of the cell.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The cell is not contained within a <see cref="T:System.Windows.Forms.DataGridView" /> control and the value of its <see cref="P:System.Windows.Forms.DataGridViewCell.RowIndex" /> property is not -1.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The cell is contained within a <see cref="T:System.Windows.Forms.DataGridView" /> control and the value of its <see cref="P:System.Windows.Forms.DataGridViewCell.RowIndex" /> property is -1.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="InheritedStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGridViewCellStyle InheritedStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.DataGridViewCellStyle InheritedStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property InheritedStyle As DataGridViewCellStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::DataGridViewCellStyle ^ InheritedStyle { System::Windows::Forms::DataGridViewCellStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.InheritedStyle : System.Windows.Forms.DataGridViewCellStyle" Usage="System.Windows.Forms.DataGridViewCell.InheritedStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridViewCellStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the style currently applied to the cell.</summary>
<value>The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> currently applied to the cell.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. The styles specified through the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance.
For more information, see [Cell Styles in the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The cell does not belong to a <see cref="T:System.Windows.Forms.DataGridView" /> control.
-or-
<see cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> is less than 0, indicating that the cell is a row header cell.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The row containing the cell is a shared row.
-or-
The cell is a column header cell.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.AdjustCellBorderStyle(System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Windows.Forms.DataGridViewAdvancedBorderStyle,System.Boolean,System.Boolean,System.Boolean,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle,System.Int32,System.Boolean)" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.HasStyle" />
<altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" />
<altmember cref="T:System.Windows.Forms.DataGridViewRow" />
<altmember cref="T:System.Windows.Forms.DataGridViewColumn" />
<altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" />
</Docs>
</Member>
<Member MemberName="InitializeEditingControl">
<MemberSignature Language="C#" Value="public virtual void InitializeEditingControl (int rowIndex, object initialFormattedValue, System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void InitializeEditingControl(int32 rowIndex, object initialFormattedValue, class System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.InitializeEditingControl(System.Int32,System.Object,System.Windows.Forms.DataGridViewCellStyle)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void InitializeEditingControl(int rowIndex, System::Object ^ initialFormattedValue, System::Windows::Forms::DataGridViewCellStyle ^ dataGridViewCellStyle);" />
<MemberSignature Language="F#" Value="abstract member InitializeEditingControl : int * obj * System.Windows.Forms.DataGridViewCellStyle -&gt; unit&#xA;override this.InitializeEditingControl : int * obj * System.Windows.Forms.DataGridViewCellStyle -&gt; unit" Usage="dataGridViewCell.InitializeEditingControl (rowIndex, initialFormattedValue, dataGridViewCellStyle)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="initialFormattedValue" Type="System.Object" />
<Parameter Name="dataGridViewCellStyle" Type="System.Windows.Forms.DataGridViewCellStyle" />
</Parameters>
<Docs>
<param name="rowIndex">The zero-based row index of the cell's location.</param>
<param name="initialFormattedValue">An <see cref="T:System.Object" /> that represents the value displayed by the cell when editing is started.</param>
<param name="dataGridViewCellStyle">A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents the style of the cell.</param>
<summary>Initializes the control used to edit the cell.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
As an optimization technique, typically all the cells of the same type and in the same <xref:System.Windows.Forms.DataGridView> share a single hosted editing control. However, before the control is used by a cell, it needs to be initialized by the <xref:System.Windows.Forms.DataGridViewCell.InitializeEditingControl%2A> method. The first time it is called, this method adds the control to the list of editing controls in its parent <xref:System.Windows.Forms.DataGridView>. It also initializes some of the visual properties of the cell. For example, <xref:System.Windows.Forms.DataGridViewCell.InitializeEditingControl%2A> sets the background color of the editing area to match the supplied cell style parameter. Subsequent calls to <xref:System.Windows.Forms.DataGridViewCell.InitializeEditingControl%2A> do nothing.
Derived classes use this method to host an instance of the <xref:System.Windows.Forms.Control> class corresponding to their type. For example, a table that contains one or more <xref:System.Windows.Forms.DataGridViewTextBoxCell> objects calls this method to add a single <xref:System.Windows.Forms.TextBox> editing control to the owning <xref:System.Windows.Forms.DataGridView>.
## Examples
The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewTextBoxCell.InitializeEditingControl%2A> method in a simple class that derives from the <xref:System.Windows.Forms.DataGridViewTextBoxCell> class. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](~/docs/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells.md).
[!code-csharp[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/CS/datagridviewcalendarcolumn.cs#200)]
[!code-vb[System.Windows.Forms.DataGridViewCalendarColumn#200](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb#200)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">There is no associated <see cref="T:System.Windows.Forms.DataGridView" /> or if one is present, it does not have an associated editing control.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.DetachEditingControl" />
</Docs>
</Member>
<Member MemberName="IsInEditMode">
<MemberSignature Language="C#" Value="public bool IsInEditMode { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsInEditMode" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGridViewCell.IsInEditMode" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsInEditMode As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsInEditMode { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsInEditMode : bool" Usage="System.Windows.Forms.DataGridViewCell.IsInEditMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether this cell is currently being edited.</summary>
<value>
<see langword="true" /> if the cell is in edit mode; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is useful when you are working directly with cell instances. Alternatively, you can use the <xref:System.Windows.Forms.DataGridView.IsCurrentCellInEditMode%2A?displayProperty=nameWithType> property. You can also handle the <xref:System.Windows.Forms.DataGridView.CellBeginEdit?displayProperty=nameWithType> event to determine when the user enters edit mode.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The row containing the cell is a shared row.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="P:System.Windows.Forms.DataGridView.IsCurrentCellInEditMode" />
<altmember cref="E:System.Windows.Forms.DataGridView.CellBeginEdit" />
</Docs>
</Member>
<Member MemberName="KeyDownUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool KeyDownUnsharesRow (System.Windows.Forms.KeyEventArgs e, int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool KeyDownUnsharesRow(class System.Windows.Forms.KeyEventArgs e, int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.KeyDownUnsharesRow(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function KeyDownUnsharesRow (e As KeyEventArgs, rowIndex As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool KeyDownUnsharesRow(System::Windows::Forms::KeyEventArgs ^ e, int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member KeyDownUnsharesRow : System.Windows.Forms.KeyEventArgs * int -&gt; bool&#xA;override this.KeyDownUnsharesRow : System.Windows.Forms.KeyEventArgs * int -&gt; bool" Usage="dataGridViewCell.KeyDownUnsharesRow (e, rowIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.KeyEventArgs" />
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Indicates whether the parent row is unshared if the user presses a key while the focus is on the cell.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.KeyDownUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnKeyDown%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnKeyDown%2A> with the same <xref:System.Windows.Forms.KeyEventArgs> argument has the effect of unsharing the row containing the cell. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyPress(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="T:System.Windows.Forms.KeyEventArgs" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="KeyEntersEditMode">
<MemberSignature Language="C#" Value="public virtual bool KeyEntersEditMode (System.Windows.Forms.KeyEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool KeyEntersEditMode(class System.Windows.Forms.KeyEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.KeyEntersEditMode(System.Windows.Forms.KeyEventArgs)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function KeyEntersEditMode (e As KeyEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool KeyEntersEditMode(System::Windows::Forms::KeyEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member KeyEntersEditMode : System.Windows.Forms.KeyEventArgs -&gt; bool&#xA;override this.KeyEntersEditMode : System.Windows.Forms.KeyEventArgs -&gt; bool" Usage="dataGridViewCell.KeyEntersEditMode e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.KeyEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that represents the key that was pressed.</param>
<summary>Determines if edit mode should be started based on the given key.</summary>
<returns>
<see langword="true" /> if edit mode should be started; otherwise, <see langword="false" />. The default is <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Override this method to create a custom cell that is editable.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="KeyPressUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool KeyPressUnsharesRow (System.Windows.Forms.KeyPressEventArgs e, int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool KeyPressUnsharesRow(class System.Windows.Forms.KeyPressEventArgs e, int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function KeyPressUnsharesRow (e As KeyPressEventArgs, rowIndex As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool KeyPressUnsharesRow(System::Windows::Forms::KeyPressEventArgs ^ e, int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member KeyPressUnsharesRow : System.Windows.Forms.KeyPressEventArgs * int -&gt; bool&#xA;override this.KeyPressUnsharesRow : System.Windows.Forms.KeyPressEventArgs * int -&gt; bool" Usage="dataGridViewCell.KeyPressUnsharesRow (e, rowIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.KeyPressEventArgs" />
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.KeyPressEventArgs" /> that contains the event data.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Indicates whether a row will be unshared if a key is pressed while a cell in the row has focus.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnKeyPress%2A> method. In derived classes, it must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnKeyPress%2A> has the effect of unsharing the row containing the cell. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyPress(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="T:System.Windows.Forms.KeyPressEventArgs" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="KeyUpUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool KeyUpUnsharesRow (System.Windows.Forms.KeyEventArgs e, int rowIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool KeyUpUnsharesRow(class System.Windows.Forms.KeyEventArgs e, int32 rowIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.KeyUpUnsharesRow(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function KeyUpUnsharesRow (e As KeyEventArgs, rowIndex As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool KeyUpUnsharesRow(System::Windows::Forms::KeyEventArgs ^ e, int rowIndex);" />
<MemberSignature Language="F#" Value="abstract member KeyUpUnsharesRow : System.Windows.Forms.KeyEventArgs * int -&gt; bool&#xA;override this.KeyUpUnsharesRow : System.Windows.Forms.KeyEventArgs * int -&gt; bool" Usage="dataGridViewCell.KeyUpUnsharesRow (e, rowIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.KeyEventArgs" />
<Parameter Name="rowIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param>
<param name="rowIndex">The index of the cell's parent row.</param>
<summary>Indicates whether the parent row is unshared when the user releases a key while the focus is on the cell.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.KeyUpUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnKeyUp%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnKeyUp%2A> with the same <xref:System.Windows.Forms.KeyEventArgs> argument has the effect of unsharing the row containing the cell. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyPress(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow(System.Windows.Forms.KeyPressEventArgs,System.Int32)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" />
<altmember cref="T:System.Windows.Forms.KeyEventArgs" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<Member MemberName="LeaveUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool LeaveUnsharesRow (int rowIndex, bool throughMouseClick);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool LeaveUnsharesRow(int32 rowIndex, bool throughMouseClick) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.LeaveUnsharesRow(System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function LeaveUnsharesRow (rowIndex As Integer, throughMouseClick As Boolean) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool LeaveUnsharesRow(int rowIndex, bool throughMouseClick);" />
<MemberSignature Language="F#" Value="abstract member LeaveUnsharesRow : int * bool -&gt; bool&#xA;override this.LeaveUnsharesRow : int * bool -&gt; bool" Usage="dataGridViewCell.LeaveUnsharesRow (rowIndex, throughMouseClick)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="throughMouseClick" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="rowIndex">The index of the cell's parent row.</param>
<param name="throughMouseClick">
<see langword="true" /> if a user action moved focus to the cell; <see langword="false" /> if a programmatic operation moved focus to the cell.</param>
<summary>Indicates whether a row will be unshared when the focus leaves a cell in the row.</summary>
<returns>
<see langword="true" /> if the row will be unshared, otherwise, <see langword="false" />. The base <see cref="T:System.Windows.Forms.DataGridViewCell" /> class always returns <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGridViewCell.LeaveUnsharesRow%2A> method is called just before the <xref:System.Windows.Forms.DataGridViewCell.OnLeave%2A> method. It must return `true` if the call to <xref:System.Windows.Forms.DataGridViewCell.OnLeave%2A> has the effect of unsharing the row containing the cell. Otherwise, it should return `false`.
For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md).
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridView" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.OnLeave(System.Int32,System.Boolean)" />
<altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseLeaveUnsharesRow(System.Int32)" />
<related type="Article" href="~/docs/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control.md">Best Practices for Scaling the Windows Forms DataGridView Control</related>
</Docs>
</Member>
<MemberGroup MemberName="MeasureTextHeight">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets the height, in pixels, of the specified text.</summary>
</Docs>
</MemberGroup>
<Member MemberName="MeasureTextHeight">
<MemberSignature Language="C#" Value="public static int MeasureTextHeight (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 MeasureTextHeight(class System.Drawing.Graphics graphics, string text, class System.Drawing.Font font, int32 maxWidth, valuetype System.Windows.Forms.TextFormatFlags flags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MeasureTextHeight(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Int32,System.Windows.Forms.TextFormatFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags);" />
<MemberSignature Language="F#" Value="static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags -&gt; int" Usage="System.Windows.Forms.DataGridViewCell.MeasureTextHeight (graphics, text, font, maxWidth, flags)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="text" Type="System.String" />
<Parameter Name="font" Type="System.Drawing.Font" />
<Parameter Name="maxWidth" Type="System.Int32" />
<Parameter Name="flags" Type="System.Windows.Forms.TextFormatFlags" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to render the text.</param>
<param name="text">The text to measure.</param>
<param name="font">The <see cref="T:System.Drawing.Font" /> applied to the text.</param>
<param name="maxWidth">The maximum width of the text.</param>
<param name="flags">A bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values to apply to the text.</param>
<summary>Gets the height, in pixels, of the specified text, given the specified characteristics.</summary>
<returns>The height, in pixels, of the text.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If multiple lines are required and the specified formatting allows it, the height returned is the combined height of all lines.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="graphics" /> is <see langword="null" />.
-or-
<paramref name="font" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="maxWidth" /> is less than 1.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="flags" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="MeasureTextHeight">
<MemberSignature Language="C#" Value="public static int MeasureTextHeight (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags, out bool widthTruncated);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 MeasureTextHeight(class System.Drawing.Graphics graphics, string text, class System.Drawing.Font font, int32 maxWidth, valuetype System.Windows.Forms.TextFormatFlags flags, [out] bool&amp; widthTruncated) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MeasureTextHeight(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Int32,System.Windows.Forms.TextFormatFlags,System.Boolean@)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags, [Runtime::InteropServices::Out] bool % widthTruncated);" />
<MemberSignature Language="F#" Value="static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags * bool -&gt; int" Usage="System.Windows.Forms.DataGridViewCell.MeasureTextHeight (graphics, text, font, maxWidth, flags, widthTruncated)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="text" Type="System.String" />
<Parameter Name="font" Type="System.Drawing.Font" />
<Parameter Name="maxWidth" Type="System.Int32" />
<Parameter Name="flags" Type="System.Windows.Forms.TextFormatFlags" />
<Parameter Name="widthTruncated" Type="System.Boolean" RefType="out" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to render the text.</param>
<param name="text">The text to measure.</param>
<param name="font">The <see cref="T:System.Drawing.Font" /> applied to the text.</param>
<param name="maxWidth">The maximum width of the text.</param>
<param name="flags">A bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values to apply to the text.</param>
<param name="widthTruncated">Set to <see langword="true" /> if the required width of the text is greater than <paramref name="maxWidth" />.</param>
<summary>Gets the height, in pixels, of the specified text, given the specified characteristics. Also indicates whether the required width is greater than the specified maximum width.</summary>
<returns>The height, in pixels, of the text.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If multiple lines are required and the specified formatting allows it, the height returned is the combined height of all lines.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="graphics" /> is <see langword="null" />.
-or-
<paramref name="font" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="maxWidth" /> is less than 1.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="flags" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="MeasureTextPreferredSize">
<MemberSignature Language="C#" Value="public static System.Drawing.Size MeasureTextPreferredSize (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, float maxRatio, System.Windows.Forms.TextFormatFlags flags);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Drawing.Size MeasureTextPreferredSize(class System.Drawing.Graphics graphics, string text, class System.Drawing.Font font, float32 maxRatio, valuetype System.Windows.Forms.TextFormatFlags flags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MeasureTextPreferredSize(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Single,System.Windows.Forms.TextFormatFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Drawing::Size MeasureTextPreferredSize(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, float maxRatio, System::Windows::Forms::TextFormatFlags flags);" />
<MemberSignature Language="F#" Value="static member MeasureTextPreferredSize : System.Drawing.Graphics * string * System.Drawing.Font * single * System.Windows.Forms.TextFormatFlags -&gt; System.Drawing.Size" Usage="System.Windows.Forms.DataGridViewCell.MeasureTextPreferredSize (graphics, text, font, maxRatio, flags)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="text" Type="System.String" />
<Parameter Name="font" Type="System.Drawing.Font" />
<Parameter Name="maxRatio" Type="System.Single" />
<Parameter Name="flags" Type="System.Windows.Forms.TextFormatFlags" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to render the text.</param>
<param name="text">The text to measure.</param>
<param name="font">The <see cref="T:System.Drawing.Font" /> applied to the text.</param>
<param name="maxRatio">The maximum width-to-height ratio of the block of text.</param>
<param name="flags">A bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values to apply to the text.</param>
<summary>Gets the ideal height and width of the specified text given the specified characteristics.</summary>
<returns>A <see cref="T:System.Drawing.Size" /> representing the preferred height and width of the text.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If multiple lines are required and the specified formatting allows it, the size returned includes the combined height of all lines.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="graphics" /> is <see langword="null" />.
-or-
<paramref name="font" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="maxRatio" /> is less than or equal to 0.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="flags" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="MeasureTextSize">
<MemberSignature Language="C#" Value="public static System.Drawing.Size MeasureTextSize (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Drawing.Size MeasureTextSize(class System.Drawing.Graphics graphics, string text, class System.Drawing.Font font, valuetype System.Windows.Forms.TextFormatFlags flags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MeasureTextSize(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Drawing::Size MeasureTextSize(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags);" />
<MemberSignature Language="F#" Value="static member MeasureTextSize : System.Drawing.Graphics * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags -&gt; System.Drawing.Size" Usage="System.Windows.Forms.DataGridViewCell.MeasureTextSize (graphics, text, font, flags)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="text" Type="System.String" />
<Parameter Name="font" Type="System.Drawing.Font" />
<Parameter Name="flags" Type="System.Windows.Forms.TextFormatFlags" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to render the text.</param>
<param name="text">The text to measure.</param>
<param name="font">The <see cref="T:System.Drawing.Font" /> applied to the text.</param>
<param name="flags">A bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values to apply to the text.</param>
<summary>Gets the height and width of the specified text given the specified characteristics.</summary>
<returns>A <see cref="T:System.Drawing.Size" /> representing the height and width of the text.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If multiple lines are required and the specified formatting allows it, the size returned includes the combined height of all lines.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="graphics" /> is <see langword="null" />.
-or-
<paramref name="font" /> is <see langword="null" />.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="flags" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="MeasureTextWidth">
<MemberSignature Language="C#" Value="public static int MeasureTextWidth (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxHeight, System.Windows.Forms.TextFormatFlags flags);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 MeasureTextWidth(class System.Drawing.Graphics graphics, string text, class System.Drawing.Font font, int32 maxHeight, valuetype System.Windows.Forms.TextFormatFlags flags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MeasureTextWidth(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Int32,System.Windows.Forms.TextFormatFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static int MeasureTextWidth(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxHeight, System::Windows::Forms::TextFormatFlags flags);" />
<MemberSignature Language="F#" Value="static member MeasureTextWidth : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags -&gt; int" Usage="System.Windows.Forms.DataGridViewCell.MeasureTextWidth (graphics, text, font, maxHeight, flags)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="text" Type="System.String" />
<Parameter Name="font" Type="System.Drawing.Font" />
<Parameter Name="maxHeight" Type="System.Int32" />
<Parameter Name="flags" Type="System.Windows.Forms.TextFormatFlags" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to render the text.</param>
<param name="text">The text to measure.</param>
<param name="font">The <see cref="T:System.Drawing.Font" /> applied to the text.</param>
<param name="maxHeight">The maximum height of the text.</param>
<param name="flags">A bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values to apply to the text.</param>
<summary>Gets the width, in pixels, of the specified text given the specified characteristics.</summary>
<returns>The width, in pixels, of the text.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="graphics" /> is <see langword="null" />.
-or-
<paramref name="font" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="maxHeight" /> is less than 1.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="flags" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.TextFormatFlags" /> values.</exception>
<altmember cref="T:System.Windows.Forms.DataGridView" />
</Docs>
</Member>
<Member MemberName="MouseClickUnsharesRow">
<MemberSignature Language="C#" Value="protected virtual bool MouseClickUnsharesRow (System.Windows.Forms.DataGridViewCellMouseEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool MouseClickUnsharesRow(class System.Windows.Forms.DataGridViewCellMouseEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGridViewCell.MouseClickUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function MouseClickUnsharesRow (e As DataGridViewCellMouseEventArgs) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual bool MouseClickUnsharesRow(System::Windows::Forms::DataGridViewCellMouseEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member MouseClickUnsharesRow : System.Windows.Forms.DataGridViewCellMouseEventArgs -&gt; bool&#xA;override this.MouseClickUnsharesRow : System.Windows.Forms.DataGridViewCellMouseEventArgs -&gt; bool" Usage="dataGridViewCell.MouseClickUnsharesRow e" />
<MemberType>Method</MemberType>
<Asse