Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
6298 lines (5692 sloc) 393 KB
<Type Name="DataGrid" FullName="System.Windows.Forms.DataGrid">
<TypeSignature Language="C#" Value="public class DataGrid : System.Windows.Forms.Control, System.ComponentModel.ISupportInitialize, System.Windows.Forms.IDataGridEditingService" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DataGrid extends System.Windows.Forms.Control implements class System.ComponentModel.ISupportInitialize, class System.Windows.Forms.IDataGridEditingService" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.DataGrid" />
<TypeSignature Language="VB.NET" Value="Public Class DataGrid&#xA;Inherits Control&#xA;Implements IDataGridEditingService, ISupportInitialize" />
<TypeSignature Language="C++ CLI" Value="public ref class DataGrid : System::Windows::Forms::Control, System::ComponentModel::ISupportInitialize, System::Windows::Forms::IDataGridEditingService" />
<TypeSignature Language="F#" Value="type DataGrid = class&#xA; inherit Control&#xA; interface ISupportInitialize&#xA; interface IDataGridEditingService" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.Control</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ComponentModel.ISupportInitialize</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Windows.Forms.IDataGridEditingService</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.ComplexBindingProperties("DataSource", "DataMember")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("Navigate")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("DataSource")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.DataGridDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.DataGridDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.DataGridDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Displays ADO.NET data in a scrollable grid. The <see cref="T:System.Windows.Forms.DataGridView" /> control replaces and adds functionality to the <see cref="T:System.Windows.Forms.DataGrid" /> control; however, the <see cref="T:System.Windows.Forms.DataGrid" /> control is retained for both backward compatibility and future use, if you choose.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> displays Web-like links to child tables. You can click on a link to navigate to the child table. When a child table is displayed, a back button appears in the caption that can be clicked to navigate back to the parent table. The data from the parent rows is displayed below the caption and above the column headers. You can hide the parent row information by clicking the button to the right of the back button.
To display a table in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> at run time, use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties to a valid data source. The following data sources are valid:
- A <xref:System.Data.DataTable>
- A <xref:System.Data.DataView>
- A <xref:System.Data.DataSet>
- A <xref:System.Data.DataViewManager>
- A single dimension array
- Any component that implements the <xref:System.ComponentModel.IListSource> interface
- Any component that implements the <xref:System.Collections.IList> interface
For more information about the <xref:System.Data.DataSet> class, see [DataSets, DataTables, and DataViews](~/docs/framework/data/adonet/dataset-datatable-dataview/index.md).
You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AllowNew%2A> property to `false`.
Data sources are further managed by <xref:System.Windows.Forms.BindingManagerBase> objects. For each table in a data source, a <xref:System.Windows.Forms.BindingManagerBase> can be returned from the form's <xref:System.Windows.Forms.BindingContext>. For example, you can determine the number of rows contained by a data source by returning the associated <xref:System.Windows.Forms.BindingManagerBase> object's <xref:System.Windows.Forms.BindingManagerBase.Count%2A> property.
To validate data, use the underlying objects that represent data and their events. For example, if the data comes from a <xref:System.Data.DataTable> in a <xref:System.Data.DataSet>, use the <xref:System.Data.DataTable.ColumnChanging> and <xref:System.Data.DataTable.RowChanging> events.
> [!NOTE]
> Because the number of columns can be customized (by adding or deleting members of the <xref:System.Windows.Forms.GridColumnStylesCollection>) and the rows can be sorted by column, the <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> property values cannot be guaranteed to correspond to <xref:System.Data.DataRow> and <xref:System.Data.DataColumn> indexes in a <xref:System.Data.DataTable>. Therefore you should avoid using those properties in the <xref:System.Windows.Forms.Control.Validating> event to validate data.
To determine which cell is selected, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property. Change the value of any cell by using the <xref:System.Windows.Forms.DataGrid.Item%2A> property, which can take either the row and column indexes of the cell, or a single <xref:System.Windows.Forms.DataGridCell>. Monitor the <xref:System.Windows.Forms.DataGrid.CurrentCellChanged> event to detect when the user selects another cell.
To determine which part of the control the user clicked, use the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in the <xref:System.Windows.Forms.Control.MouseDown> event. The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method returns a <xref:System.Windows.Forms.DataGrid.HitTestInfo> object, which contains the row and column of a clicked area.
To manage the appearance of the control at run time, several properties for setting the color and caption attributes are available, including the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionFont%2A>, and so on.
The appearance of the displayed grid (or grids) can be further modified by creating <xref:System.Windows.Forms.DataGridTableStyle> objects and adding them to the <xref:System.Windows.Forms.GridTableStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> containing three <xref:System.Data.DataTable> objects, you can add three <xref:System.Windows.Forms.DataGridTableStyle> objects to the collection, one for each table. To synchronize each <xref:System.Windows.Forms.DataGridTableStyle> object with a <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. For more information about binding to an array of objects, see the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property.
To create a customized view of a table, create an instance of a <xref:System.Windows.Forms.DataGridTextBoxColumn> or <xref:System.Windows.Forms.DataGridBoolColumn> class and add the object to the <xref:System.Windows.Forms.GridTableStylesCollection> accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. Both classes inherit from <xref:System.Windows.Forms.DataGridColumnStyle>. For each column style, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a column that you want to show in the grid. To hide a column, set its <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to something other than a valid <xref:System.Data.DataColumn.ColumnName%2A>.
To format the text of a column, set the <xref:System.Windows.Forms.DataGridTextBoxColumn.Format%2A> property of the <xref:System.Windows.Forms.DataGridTextBoxColumn> to one of the values found in [Formatting Types](~/docs/standard/base-types/formatting-types.md) and [Custom Date and Time Format Strings](~/docs/standard/base-types/custom-date-and-time-format-strings.md).
To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename[]` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example.
You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name).
For each <xref:System.Windows.Forms.DataGridTableStyle>, you can set color and caption attributes that override the settings for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. However, if those properties are not set, the settings for the control are used by default. The following properties can be overridden by <xref:System.Windows.Forms.DataGridTableStyle> properties:
- <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.AlternatingBackColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.BackColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisible%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.ForeColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.GridLineColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.GridLineStyle%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.HeaderBackColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.HeaderFont%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.HeaderForeColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.LinkColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.PreferredColumnWidth%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.PreferredRowHeight%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.ReadOnly%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.RowHeadersVisible%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.RowHeaderWidth%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.SelectionBackColor%2A>
- <xref:System.Windows.Forms.DataGridTableStyle.SelectionForeColor%2A>
To customize the appearance of individual columns, add <xref:System.Windows.Forms.DataGridColumnStyle> objects to the <xref:System.Windows.Forms.GridColumnStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property of each <xref:System.Windows.Forms.DataGridTableStyle>. To synchronize each <xref:System.Windows.Forms.DataGridColumnStyle> with a <xref:System.Data.DataColumn> in the <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a <xref:System.Data.DataColumn>. When constructing a <xref:System.Windows.Forms.DataGridColumnStyle>, you can also set a formatting string that specifies how the column displays data. For example, you can specify that the column use a short-date format to display dates contained in the table.
> [!CAUTION]
> Always create <xref:System.Windows.Forms.DataGridColumnStyle> objects and add them to the <xref:System.Windows.Forms.GridColumnStylesCollection> before adding <xref:System.Windows.Forms.DataGridTableStyle> objects to the <xref:System.Windows.Forms.GridTableStylesCollection>. When you add an empty <xref:System.Windows.Forms.DataGridTableStyle> with a valid <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> value to the collection, <xref:System.Windows.Forms.DataGridColumnStyle> objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new <xref:System.Windows.Forms.DataGridColumnStyle> objects with duplicate <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> values to the <xref:System.Windows.Forms.GridColumnStylesCollection>.
> [!NOTE]
> The <xref:System.Windows.Forms.DataGridView> control replaces and adds functionality to the <xref:System.Windows.Forms.DataGrid> control; however, the <xref:System.Windows.Forms.DataGrid> control is retained for both backward compatibility and future use, if you choose. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid Controls](~/docs/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls.md).
## Examples
The following code example creates a Windows form, a <xref:System.Data.DataSet> containing two <xref:System.Data.DataTable> objects, and a <xref:System.Data.DataRelation> that relates the two tables. To display the data, a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control is then bound to the <xref:System.Data.DataSet> through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method. A button on the form changes the appearance of the grid by creating two <xref:System.Windows.Forms.DataGridTableStyle> objects and setting the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of each object to a <xref:System.Data.DataTable.TableName%2A> of one of the <xref:System.Data.DataTable> objects. The example also contains code in the <xref:System.Windows.Forms.Control.MouseUp> event that uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method to print the column, row, and part of the grid that has been clicked.
[!code-cpp[Classic DataGrid Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Data.DataSet" />
<altmember cref="T:System.Data.DataView" />
<altmember cref="T:System.Data.DataTable" />
<altmember cref="T:System.Data.DataRow" />
<related type="Article" href="~/docs/framework/data/adonet/index.md">ADO.NET</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DataGrid ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DataGrid();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.DataGrid" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To populate a newly created <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property to a valid source, such as a <xref:System.Data.DataView>, <xref:System.Data.DataSet>, or <xref:System.Data.DataViewManager>.
## Examples
The following code example creates a new <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> and uses the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties.
[!code-vb[Classic DataGrid.DataGrid Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataGrid Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Data.DataColumnCollection" />
<altmember cref="T:System.Data.DataColumn" />
<altmember cref="P:System.Windows.Forms.DataGrid.DataMember" />
<altmember cref="T:System.Data.DataView" />
<altmember cref="T:System.Data.DataTable" />
<altmember cref="T:System.Windows.Forms.GridTableStylesCollection" />
</Docs>
</Member>
<Member MemberName="AllowNavigation">
<MemberSignature Language="C#" Value="public bool AllowNavigation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowNavigation" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.AllowNavigation" />
<MemberSignature Language="VB.NET" Value="Public Property AllowNavigation As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AllowNavigation { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowNavigation : bool with get, set" Usage="System.Windows.Forms.DataGrid.AllowNavigation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether navigation is allowed.</summary>
<value>
<see langword="true" /> if navigation is allowed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If this property is set to `false`, links to child tables are not shown.
## Examples
The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property between the `true` and `false`.
[!code-cpp[DataGrid_AllowNavigationChanged#1](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp#1)]
[!code-csharp[DataGrid_AllowNavigationChanged#1](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CS/mydatagrid_allownavigationchanged.cs#1)]
[!code-vb[DataGrid_AllowNavigationChanged#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AllowNavigationChanged">
<MemberSignature Language="C#" Value="public event EventHandler AllowNavigationChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler AllowNavigationChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.AllowNavigationChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AllowNavigationChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ AllowNavigationChanged;" />
<MemberSignature Language="F#" Value="member this.AllowNavigationChanged : EventHandler " Usage="member this.AllowNavigationChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.AllowNavigation" /> property has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property is set to `false`, then no links to child tables are shown.
## Examples
The following code example resets the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property and raises the <xref:System.Windows.Forms.DataGrid.AllowNavigationChanged> event.
[!code-cpp[DataGrid_AllowNavigationChanged#1](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp#1)]
[!code-csharp[DataGrid_AllowNavigationChanged#1](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CS/mydatagrid_allownavigationchanged.cs#1)]
[!code-vb[DataGrid_AllowNavigationChanged#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AllowSorting">
<MemberSignature Language="C#" Value="public bool AllowSorting { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowSorting" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.AllowSorting" />
<MemberSignature Language="VB.NET" Value="Public Property AllowSorting As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AllowSorting { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowSorting : bool with get, set" Usage="System.Windows.Forms.DataGrid.AllowSorting" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the grid can be resorted by clicking on a column header.</summary>
<value>
<see langword="true" /> if columns can be sorted; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is overridden by the <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A?displayProperty=nameWithType> property if there is a <xref:System.Windows.Forms.DataGridTableStyle> currently in effect for the control.
If sorting is allowed, clicking on a column header will sort the table data by that column.
You can also sort using an expression for a <xref:System.Data.DataColumn>. See <xref:System.Data.DataColumn.Expression%2A> for details on creating a sort expression.
If the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataView>, you can set a custom sort for the table using the <xref:System.Data.DataView> class's <xref:System.Data.DataView.Sort%2A> property. Similarly, if the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataViewManager>, each table in the <xref:System.Data.DataViewManager> can have a custom sort by setting the <xref:System.Data.DataViewManager.DataViewSettings%2A> class's <xref:System.Data.DataViewSetting.Sort%2A> property.
## Examples
The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowSorting%2A> property.
[!code-cpp[Classic DataGrid.AllowSorting Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.AllowSorting Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.AllowSorting Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Data.DataColumn.Expression" />
<altmember cref="P:System.Data.DataView.Sort" />
<altmember cref="P:System.Data.DataViewSetting.Sort" />
<altmember cref="T:System.Windows.Forms.DataGridTableStyle" />
<altmember cref="P:System.Windows.Forms.DataGridTableStyle.AllowSorting" />
</Docs>
</Member>
<Member MemberName="AlternatingBackColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color AlternatingBackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color AlternatingBackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.AlternatingBackColor" />
<MemberSignature Language="VB.NET" Value="Public Property AlternatingBackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color AlternatingBackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.AlternatingBackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.AlternatingBackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color of odd-numbered rows of the grid.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the alternating background color. The default is the system color for windows (<see cref="P:System.Drawing.SystemColors.Window" />).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows.
## Examples
The following code example sets the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> to a <xref:System.Drawing.Color> value.
[!code-vb[Classic DataGrid.AlternatingBackColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AlternatingBackColor Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackButtonClick">
<MemberSignature Language="C#" Value="public event EventHandler BackButtonClick;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackButtonClick" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.BackButtonClick" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackButtonClick As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackButtonClick;" />
<MemberSignature Language="F#" Value="member this.BackButtonClick : EventHandler " Usage="member this.BackButtonClick : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see langword="Back" /> button on a child table is clicked.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `Back` button becomes visible when a child table is displayed. Clicking the button will cause the grid to display the parent table.
## Examples
The following code example adds an event handler for the <xref:System.Windows.Forms.DataGrid.BackButtonClick> event.
[!code-cpp[DataGrid_BackgroundColorChanged#1](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp#1)]
[!code-csharp[DataGrid_BackgroundColorChanged#1](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CS/mydatagrid_backgroundcolorchanged.cs#1)]
[!code-vb[DataGrid_BackgroundColorChanged#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.AllowNavigation" />
</Docs>
</Member>
<Member MemberName="BackColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.BackColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.BackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color of even-numbered rows of the grid.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the color of rows in the grid. The default is the system color for windows (<see cref="P:System.Drawing.SystemColors.Window" />).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Whereas the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property determines the color of rows in the grid, the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area, which is only visible when the grid is scrolled to the bottom, or if only a few rows are contained in the grid.
By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows.
## Examples
The following code example sets both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties to different values.
[!code-cpp[Classic DataGrid.BackColor Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.BackColor Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.BackColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.BackgroundColor" />
</Docs>
</Member>
<Member MemberName="BackgroundColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color BackgroundColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackgroundColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.BackgroundColor" />
<MemberSignature Language="VB.NET" Value="Public Property BackgroundColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color BackgroundColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.BackgroundColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the color of the non-row area of the grid.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the color of the grid's background. The default is the <see cref="P:System.Drawing.SystemColors.AppWorkspace" /> color.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area of the grid, which is only visible when no table is displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or if the grid is scrolled to the bottom, or if only a few rows are contained in the grid.
## Examples
The following code example sets the <xref:System.Windows.Forms.DataGrid.BackColor%2A>, and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties.
[!code-cpp[Classic DataGrid.BackgroundColor Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.BackgroundColor Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.BackgroundColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.BackColor" />
</Docs>
</Member>
<Member MemberName="BackgroundColorChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundColorChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundColorChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.BackgroundColorChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundColorChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundColorChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundColorChanged : EventHandler " Usage="member this.BackgroundColorChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.BackgroundColor" /> has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example changes the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> property value from yellow to red and raises the <xref:System.Windows.Forms.DataGrid.BackgroundColorChanged> event.
[!code-cpp[DataGrid_BackgroundColorChanged#2](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp#2)]
[!code-csharp[DataGrid_BackgroundColorChanged#2](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CS/mydatagrid_backgroundcolorchanged.cs#2)]
[!code-vb[DataGrid_BackgroundColorChanged#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImage">
<MemberSignature Language="C#" Value="public override System.Drawing.Image BackgroundImage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image BackgroundImage" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.BackgroundImage" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImage As Image" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Image ^ BackgroundImage { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImage : System.Drawing.Image with get, set" Usage="System.Windows.Forms.DataGrid.BackgroundImage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>This member is not meaningful for this control.</summary>
<value>The background image associated with the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.BackgroundImageChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageChanged : EventHandler " Usage="member this.BackgroundImageChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.BackgroundImage" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.BackgroundImage%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageChanged> event to detect the change.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayout">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.ImageLayout BackgroundImageLayout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImageLayout BackgroundImageLayout" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.BackgroundImageLayout" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImageLayout As ImageLayout" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::ImageLayout BackgroundImageLayout { System::Windows::Forms::ImageLayout get(); void set(System::Windows::Forms::ImageLayout value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayout : System.Windows.Forms.ImageLayout with get, set" Usage="System.Windows.Forms.DataGrid.BackgroundImageLayout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageLayout</ReturnType>
</ReturnValue>
<Docs>
<summary>This member is not meaningful for this control.</summary>
<value>An <see cref="T:System.Windows.Forms.ImageLayout" /> value.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayoutChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageLayoutChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageLayoutChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.BackgroundImageLayoutChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageLayoutChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageLayoutChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayoutChanged : EventHandler " Usage="member this.BackgroundImageLayoutChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.BackgroundImageLayout" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.BackgroundImageLayout%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageLayoutChanged> event to detect the change.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BeginEdit">
<MemberSignature Language="C#" Value="public bool BeginEdit (System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool BeginEdit(class System.Windows.Forms.DataGridColumnStyle gridColumn, int32 rowNumber) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.BeginEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function BeginEdit (gridColumn As DataGridColumnStyle, rowNumber As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool BeginEdit(System::Windows::Forms::DataGridColumnStyle ^ gridColumn, int rowNumber);" />
<MemberSignature Language="F#" Value="abstract member BeginEdit : System.Windows.Forms.DataGridColumnStyle * int -&gt; bool&#xA;override this.BeginEdit : System.Windows.Forms.DataGridColumnStyle * int -&gt; bool" Usage="dataGrid.BeginEdit (gridColumn, rowNumber)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Windows.Forms.IDataGridEditingService.BeginEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="gridColumn" Type="System.Windows.Forms.DataGridColumnStyle" />
<Parameter Name="rowNumber" Type="System.Int32" />
</Parameters>
<Docs>
<param name="gridColumn">A <see cref="T:System.Windows.Forms.DataGridColumnStyle" /> to edit.</param>
<param name="rowNumber">The number of the row to edit.</param>
<summary>Attempts to put the grid into a state where editing is allowed.</summary>
<returns>
<see langword="true" /> if the method is successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The grid will deny edit requests if the user already started typing into a cell. In that case, the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method will return `false`.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method to test if editing is possible before changing a specified column and row.
[!code-cpp[Classic DataGrid.BeginEdit Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.BeginEdit Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.BeginEdit Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.EndEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32,System.Boolean)" />
</Docs>
</Member>
<Member MemberName="BeginInit">
<MemberSignature Language="C#" Value="public void BeginInit ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void BeginInit() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.BeginInit" />
<MemberSignature Language="VB.NET" Value="Public Sub BeginInit ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void BeginInit();" />
<MemberSignature Language="F#" Value="abstract member BeginInit : unit -&gt; unit&#xA;override this.BeginInit : unit -&gt; unit" Usage="dataGrid.BeginInit " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ComponentModel.ISupportInitialize.BeginInit</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Begins the initialization of a <see cref="T:System.Windows.Forms.DataGrid" /> that is used on a form or used by another component. The initialization occurs at run time.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The Visual Studio design environment uses this method to start the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.EndInit%2A> method ends the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized.
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.EndInit" />
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Property BorderStyle As BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set" Usage="System.Windows.Forms.DataGrid.BorderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(-504)</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.Windows.Forms.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the grid's border style.</summary>
<value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> enumeration values. The default is <see langword="FixedSingle" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the style of the grid's border.
[!code-vb[Classic DataGrid.BorderStyle Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BorderStyle Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BorderStyleChanged">
<MemberSignature Language="C#" Value="public event EventHandler BorderStyleChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BorderStyleChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.BorderStyleChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BorderStyleChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BorderStyleChanged;" />
<MemberSignature Language="F#" Value="member this.BorderStyleChanged : EventHandler " Usage="member this.BorderStyleChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.BorderStyle" /> has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Possible values include `None`, `FixedSingle`, and `Fixed3D`.
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGrid> named `DataGrid1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event.
[!code-csharp[System.Windows.Forms.EventExamples#194](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#194)]
[!code-vb[System.Windows.Forms.EventExamples#194](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#194)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CancelEditing">
<MemberSignature Language="C#" Value="protected virtual void CancelEditing ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void CancelEditing() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.CancelEditing" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub CancelEditing ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void CancelEditing();" />
<MemberSignature Language="F#" Value="abstract member CancelEditing : unit -&gt; unit&#xA;override this.CancelEditing : unit -&gt; unit" Usage="dataGrid.CancelEditing " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Cancels the current edit operation and rolls back all changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CaptionBackColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color CaptionBackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color CaptionBackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CaptionBackColor" />
<MemberSignature Language="VB.NET" Value="Public Property CaptionBackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color CaptionBackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.CaptionBackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.CaptionBackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color of the caption area.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the caption's background color. The default is <see cref="P:System.Drawing.SystemColors.ActiveCaption" /> color.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control.
[!code-vb[Classic DataGrid.CaptionBackColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionBackColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionForeColor" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionFont" />
</Docs>
</Member>
<Member MemberName="CaptionFont">
<MemberSignature Language="C#" Value="public System.Drawing.Font CaptionFont { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Font CaptionFont" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CaptionFont" />
<MemberSignature Language="VB.NET" Value="Public Property CaptionFont As Font" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Font ^ CaptionFont { System::Drawing::Font ^ get(); void set(System::Drawing::Font ^ value); };" />
<MemberSignature Language="F#" Value="member this.CaptionFont : System.Drawing.Font with get, set" Usage="System.Windows.Forms.DataGrid.CaptionFont" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.AmbientValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Font</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the font of the grid's caption.</summary>
<value>A <see cref="T:System.Drawing.Font" /> that represents the caption's font.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.Drawing.Font> encapsulates a Windows font and provides the methods for manipulating that font.
## Examples
The following code example sets the caption's font using a <xref:System.Drawing.Font> object.
[!code-vb[Classic DataGrid.CaptionFont Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionFont Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionBackColor" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionForeColor" />
</Docs>
</Member>
<Member MemberName="CaptionForeColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color CaptionForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color CaptionForeColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CaptionForeColor" />
<MemberSignature Language="VB.NET" Value="Public Property CaptionForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color CaptionForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.CaptionForeColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.CaptionForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the foreground color of the caption area.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the caption area. The default is <see cref="P:System.Drawing.SystemColors.ActiveCaptionText" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control.
[!code-vb[Classic DataGrid.CaptionForeColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionForeColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionBackColor" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionFont" />
</Docs>
</Member>
<Member MemberName="CaptionText">
<MemberSignature Language="C#" Value="public string CaptionText { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string CaptionText" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CaptionText" />
<MemberSignature Language="VB.NET" Value="Public Property CaptionText As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ CaptionText { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.CaptionText : string with get, set" Usage="System.Windows.Forms.DataGrid.CaptionText" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text of the grid's window caption.</summary>
<value>A string to be displayed as the window caption of the grid. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the caption of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>.
[!code-cpp[Classic DataGrid.CaptionText Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.CaptionText Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.CaptionText Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionVisible" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionForeColor" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionFont" />
<altmember cref="P:System.Windows.Forms.DataGrid.CaptionBackColor" />
</Docs>
</Member>
<Member MemberName="CaptionVisible">
<MemberSignature Language="C#" Value="public bool CaptionVisible { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CaptionVisible" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CaptionVisible" />
<MemberSignature Language="VB.NET" Value="Public Property CaptionVisible As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool CaptionVisible { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.CaptionVisible : bool with get, set" Usage="System.Windows.Forms.DataGrid.CaptionVisible" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the grid's caption is visible.</summary>
<value>
<see langword="true" /> if the caption is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> is `false`, the **Back** button, **ParentRow** button, and caption will not be seen. Because navigation is limited, links to child tables will also not be visible and <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> will be set to `None`.
## Examples
The following code example toggles the <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> property.
[!code-vb[Classic DataGrid.CaptionVisible Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionVisible Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CaptionVisibleChanged">
<MemberSignature Language="C#" Value="public event EventHandler CaptionVisibleChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler CaptionVisibleChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.CaptionVisibleChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event CaptionVisibleChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ CaptionVisibleChanged;" />
<MemberSignature Language="F#" Value="member this.CaptionVisibleChanged : EventHandler " Usage="member this.CaptionVisibleChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.CaptionVisible" /> property has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the use of this event.
[!code-cpp[DataGrid_CaptionVisibleChanged#1](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp#1)]
[!code-csharp[DataGrid_CaptionVisibleChanged#1](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CS/mydatagrid_captionvisiblechanged.cs#1)]
[!code-vb[DataGrid_CaptionVisibleChanged#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Collapse">
<MemberSignature Language="C#" Value="public void Collapse (int row);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Collapse(int32 row) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.Collapse(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub Collapse (row As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Collapse(int row);" />
<MemberSignature Language="F#" Value="member this.Collapse : int -&gt; unit" Usage="dataGrid.Collapse row" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="row" Type="System.Int32" />
</Parameters>
<Docs>
<param name="row">The number of the row to collapse. If set to -1, all rows are collapsed.</param>
<summary>Collapses child relations, if any exist for all rows, or for a specified row.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Windows.Forms.DataGrid.IsExpanded%2A> method to determine if a row is expanded.
## Examples
The following code example collapses all rows in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control.
[!code-vb[Classic DataGrid.Collapse Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Collapse Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.IsExpanded(System.Int32)" />
</Docs>
</Member>
<Member MemberName="ColumnHeadersVisible">
<MemberSignature Language="C#" Value="public bool ColumnHeadersVisible { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ColumnHeadersVisible" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.ColumnHeadersVisible" />
<MemberSignature Language="VB.NET" Value="Public Property ColumnHeadersVisible As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool ColumnHeadersVisible { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ColumnHeadersVisible : bool with get, set" Usage="System.Windows.Forms.DataGrid.ColumnHeadersVisible" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the column headers of a table are visible.</summary>
<value>
<see langword="true" /> if the column headers are visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example toggles the <xref:System.Windows.Forms.DataGrid.ColumnHeadersVisible%2A> property.
[!code-vb[Classic DataGrid.ColumnHeadersVisible Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ColumnHeadersVisible Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridColumnStyle" />
<altmember cref="T:System.Windows.Forms.GridColumnStylesCollection" />
<altmember cref="P:System.Windows.Forms.DataGrid.RowHeadersVisible" />
<altmember cref="P:System.Windows.Forms.DataGrid.VisibleColumnCount" />
<altmember cref="P:System.Windows.Forms.DataGrid.VisibleRowCount" />
</Docs>
</Member>
<MemberGroup MemberName="ColumnStartedEditing">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Informs the <see cref="T:System.Windows.Forms.DataGrid" /> control that the user has begun editing a column.</summary>
</Docs>
</MemberGroup>
<Member MemberName="ColumnStartedEditing">
<MemberSignature Language="C#" Value="protected internal virtual void ColumnStartedEditing (System.Drawing.Rectangle bounds);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance void ColumnStartedEditing(valuetype System.Drawing.Rectangle bounds) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.ColumnStartedEditing(System.Drawing.Rectangle)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Sub ColumnStartedEditing (bounds As Rectangle)" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual void ColumnStartedEditing(System::Drawing::Rectangle bounds);" />
<MemberSignature Language="F#" Value="abstract member ColumnStartedEditing : System.Drawing.Rectangle -&gt; unit&#xA;override this.ColumnStartedEditing : System.Drawing.Rectangle -&gt; unit" Usage="dataGrid.ColumnStartedEditing bounds" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="bounds" Type="System.Drawing.Rectangle" />
</Parameters>
<Docs>
<param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that defines the location of the edited column.</param>
<summary>Informs the <see cref="T:System.Windows.Forms.DataGrid" /> control when the user begins to edit the column at the specified location.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ColumnStartedEditing">
<MemberSignature Language="C#" Value="protected internal virtual void ColumnStartedEditing (System.Windows.Forms.Control editingControl);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance void ColumnStartedEditing(class System.Windows.Forms.Control editingControl) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.ColumnStartedEditing(System.Windows.Forms.Control)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Sub ColumnStartedEditing (editingControl As Control)" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual void ColumnStartedEditing(System::Windows::Forms::Control ^ editingControl);" />
<MemberSignature Language="F#" Value="abstract member ColumnStartedEditing : System.Windows.Forms.Control -&gt; unit&#xA;override this.ColumnStartedEditing : System.Windows.Forms.Control -&gt; unit" Usage="dataGrid.ColumnStartedEditing editingControl" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="editingControl" Type="System.Windows.Forms.Control" />
</Parameters>
<Docs>
<param name="editingControl">The <see cref="T:System.Windows.Forms.Control" /> used to edit the column.</param>
<summary>Informs the <see cref="T:System.Windows.Forms.DataGrid" /> control when the user begins to edit a column using the specified control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CreateAccessibilityInstance">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.AccessibleObject CreateAccessibilityInstance ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Forms.AccessibleObject CreateAccessibilityInstance() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.CreateAccessibilityInstance" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateAccessibilityInstance () As AccessibleObject" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Windows::Forms::AccessibleObject ^ CreateAccessibilityInstance();" />
<MemberSignature Language="F#" Value="override this.CreateAccessibilityInstance : unit -&gt; System.Windows.Forms.AccessibleObject" Usage="dataGrid.CreateAccessibilityInstance " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.AccessibleObject</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Constructs a new instance of the accessibility object for this control.</summary>
<returns>The <see cref="T:System.Windows.Forms.Control.ControlAccessibleObject" /> for this control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Derived classes should not call the base class's <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A> method.
Only the following properties of the <xref:System.Windows.Forms.AccessibleObject> should be set:
- <xref:System.Windows.Forms.AccessibleObject.Role%2A>
- <xref:System.Windows.Forms.AccessibleObject.Description%2A>
- <xref:System.Windows.Forms.AccessibleObject.Name%2A>
All other properties are handled by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> itself.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.AccessibleObject" />
</Docs>
</Member>
<MemberGroup MemberName="CreateGridColumn">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a new <see cref="T:System.Windows.Forms.DataGridColumnStyle" /> that is added to the control.</summary>
</Docs>
</MemberGroup>
<Member MemberName="CreateGridColumn">
<MemberSignature Language="C#" Value="protected virtual System.Windows.Forms.DataGridColumnStyle CreateGridColumn (System.ComponentModel.PropertyDescriptor prop);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Windows.Forms.DataGridColumnStyle CreateGridColumn(class System.ComponentModel.PropertyDescriptor prop) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.CreateGridColumn(System.ComponentModel.PropertyDescriptor)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateGridColumn (prop As PropertyDescriptor) As DataGridColumnStyle" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Windows::Forms::DataGridColumnStyle ^ CreateGridColumn(System::ComponentModel::PropertyDescriptor ^ prop);" />
<MemberSignature Language="F#" Value="abstract member CreateGridColumn : System.ComponentModel.PropertyDescriptor -&gt; System.Windows.Forms.DataGridColumnStyle&#xA;override this.CreateGridColumn : System.ComponentModel.PropertyDescriptor -&gt; System.Windows.Forms.DataGridColumnStyle" Usage="dataGrid.CreateGridColumn prop" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridColumnStyle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="prop" Type="System.ComponentModel.PropertyDescriptor" />
</Parameters>
<Docs>
<param name="prop">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to use for creating the grid column style.</param>
<summary>Creates a new <see cref="T:System.Windows.Forms.DataGridColumnStyle" /> with the specified <see cref="T:System.ComponentModel.PropertyDescriptor" />.</summary>
<returns>The new <see cref="T:System.Windows.Forms.DataGridColumnStyle" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateGridColumn">
<MemberSignature Language="C#" Value="protected virtual System.Windows.Forms.DataGridColumnStyle CreateGridColumn (System.ComponentModel.PropertyDescriptor prop, bool isDefault);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Windows.Forms.DataGridColumnStyle CreateGridColumn(class System.ComponentModel.PropertyDescriptor prop, bool isDefault) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.CreateGridColumn(System.ComponentModel.PropertyDescriptor,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateGridColumn (prop As PropertyDescriptor, isDefault As Boolean) As DataGridColumnStyle" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Windows::Forms::DataGridColumnStyle ^ CreateGridColumn(System::ComponentModel::PropertyDescriptor ^ prop, bool isDefault);" />
<MemberSignature Language="F#" Value="abstract member CreateGridColumn : System.ComponentModel.PropertyDescriptor * bool -&gt; System.Windows.Forms.DataGridColumnStyle&#xA;override this.CreateGridColumn : System.ComponentModel.PropertyDescriptor * bool -&gt; System.Windows.Forms.DataGridColumnStyle" Usage="dataGrid.CreateGridColumn (prop, isDefault)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridColumnStyle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="prop" Type="System.ComponentModel.PropertyDescriptor" />
<Parameter Name="isDefault" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="prop">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to use for creating the grid column style.</param>
<param name="isDefault">
<see langword="true" /> to set the column style as the default; otherwise, <see langword="false" />.</param>
<summary>Creates a <see cref="T:System.Windows.Forms.DataGridColumnStyle" /> using the specified <see cref="T:System.ComponentModel.PropertyDescriptor" />.</summary>
<returns>The new <see cref="T:System.Windows.Forms.DataGridColumnStyle" />.</returns>
<remarks>To be added.</remarks>
<altmember cref="T:System.Windows.Forms.DataGridColumnStyle" />
<altmember cref="T:System.Windows.Forms.GridColumnStylesCollection" />
</Docs>
</Member>
<Member MemberName="CurrentCell">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGridCell CurrentCell { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.DataGridCell CurrentCell" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CurrentCell" />
<MemberSignature Language="VB.NET" Value="Public Property CurrentCell As DataGridCell" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::DataGridCell CurrentCell { System::Windows::Forms::DataGridCell get(); void set(System::Windows::Forms::DataGridCell value); };" />
<MemberSignature Language="F#" Value="member this.CurrentCell : System.Windows.Forms.DataGridCell with get, set" Usage="System.Windows.Forms.DataGrid.CurrentCell" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGridCell</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets which cell has the focus. Not available at design time.</summary>
<value>The <see cref="T:System.Windows.Forms.DataGridCell" /> with the focus.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property will cause the grid to scroll and show the cell if it is not already visible.
## Examples
The following code example shows how to set and get the current cell.
[!code-cpp[Classic DataGrid.CurrentCell Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.CurrentCell Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.CurrentCell Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.DataGridCell" />
<altmember cref="P:System.Windows.Forms.DataGrid.FirstVisibleColumn" />
</Docs>
</Member>
<Member MemberName="CurrentCellChanged">
<MemberSignature Language="C#" Value="public event EventHandler CurrentCellChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler CurrentCellChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.CurrentCellChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event CurrentCellChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ CurrentCellChanged;" />
<MemberSignature Language="F#" Value="member this.CurrentCellChanged : EventHandler " Usage="member this.CurrentCellChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.CurrentCell" /> property has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To determine the current cell, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property.
## Examples
The following code example demonstrates the use of this member.
[!code-cpp[DataGrid_CaptionVisibleChanged#2](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp#2)]
[!code-csharp[DataGrid_CaptionVisibleChanged#2](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CS/mydatagrid_captionvisiblechanged.cs#2)]
[!code-vb[DataGrid_CaptionVisibleChanged#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CurrentRowIndex">
<MemberSignature Language="C#" Value="public int CurrentRowIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 CurrentRowIndex" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.CurrentRowIndex" />
<MemberSignature Language="VB.NET" Value="Public Property CurrentRowIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int CurrentRowIndex { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.CurrentRowIndex : int with get, set" Usage="System.Windows.Forms.DataGrid.CurrentRowIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets index of the row that currently has focus.</summary>
<value>The zero-based index of the current row.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property to a value other than its current value scrolls the control so that the specified row is in view.
The <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> will cause the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display the next set of records in the child table that are linked to the parent table.
If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row.
## Examples
The following code example returns the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A>.
[!code-cpp[Classic DataGrid.CurrentRowIndex Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.CurrentRowIndex Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.CurrentRowIndex Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Exception">There is no <see cref="T:System.Windows.Forms.CurrencyManager" />.</exception>
<altmember cref="T:System.Windows.Forms.CurrencyManager" />
</Docs>
</Member>
<Member MemberName="Cursor">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.Cursor Cursor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.Cursor Cursor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.Cursor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property Cursor As Cursor" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::Cursor ^ Cursor { System::Windows::Forms::Cursor ^ get(); void set(System::Windows::Forms::Cursor ^ value); };" />
<MemberSignature Language="F#" Value="member this.Cursor : System.Windows.Forms.Cursor with get, set" Usage="System.Windows.Forms.DataGrid.Cursor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.Cursor</ReturnType>
</ReturnValue>
<Docs>
<summary>This member is not meaningful for this control.</summary>
<value>The type of cursor to display as the mouse pointer moves over the object.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CursorChanged">
<MemberSignature Language="C#" Value="public event EventHandler CursorChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler CursorChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.CursorChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event CursorChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ CursorChanged;" />
<MemberSignature Language="F#" Value="member this.CursorChanged : EventHandler " Usage="member this.CursorChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.Cursor" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.Cursor%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.CursorChanged> event to detect the change.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DataMember">
<MemberSignature Language="C#" Value="public string DataMember { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DataMember" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.DataMember" />
<MemberSignature Language="VB.NET" Value="Public Property DataMember As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ DataMember { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.DataMember : string with get, set" Usage="System.Windows.Forms.DataGrid.DataMember" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.DataMemberListEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.DataMemberListEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.DataMemberListEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</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.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the specific list in a <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> for which the <see cref="T:System.Windows.Forms.DataGrid" /> control displays a grid.</summary>
<value>A list in a <see cref="P:System.Windows.Forms.DataGrid.DataSource" />. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a <xref:System.Windows.Forms.DataGrid.DataSource%2A> contains multiple sources of data, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to one of the sources. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify one of the tables to bind to. If the <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> contains only one <xref:System.Data.DataTable>, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the <xref:System.Data.DataTable.TableName%2A> of that <xref:System.Data.DataTable>.
If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> that contains <xref:System.Data.DataRelation> objects, parent tables will appear with a plus sign (+) in each row header. Clicking the plus sign causes a node to appear that contains links to child tables. For example, if a <xref:System.Data.DataSet> contains two <xref:System.Data.DataTable> objects named `Customers` and `Orders`, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the `Customers` table causes the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display a parent table with a plus sign visible on each row header. If the <xref:System.Windows.Forms.DataGrid.DataMember%2A> is set to `Orders`, however, the row headers will be blank.
If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataTable>, <xref:System.Data.DataView>, collection, or array, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property throws an exception.
> [!NOTE]
> At run time, you must use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to reset the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property. However, the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property alone can be reset at any time to a valid table name.
## Examples
The following code example sets the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control.
[!code-cpp[Classic DataGrid.DataMember Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.DataMember Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.DataMember Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.DataSource" />
<altmember cref="T:System.Data.DataSet" />
<altmember cref="T:System.Data.DataViewManager" />
<altmember cref="M:System.Windows.Forms.DataGrid.SetDataBinding(System.Object,System.String)" />
</Docs>
</Member>
<Member MemberName="DataSource">
<MemberSignature Language="C#" Value="public object DataSource { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object DataSource" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.DataSource" />
<MemberSignature Language="VB.NET" Value="Public Property DataSource As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ DataSource { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.DataSource : obj with get, set" Usage="System.Windows.Forms.DataGrid.DataSource" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.AttributeProvider(typeof(System.ComponentModel.IListSource))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.TypeConverter("System.Windows.Forms.Design.DataSourceConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</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.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the data source that the grid is displaying data for.</summary>
<value>An object that functions as a data source.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
At run time, use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties.
The following data sources are valid:
- A <xref:System.Data.DataTable>
- A <xref:System.Data.DataView>
- A <xref:System.Data.DataSet>
- A <xref:System.Data.DataViewManager>
- Any component that implements the <xref:System.ComponentModel.IListSource> interface
- Any component that implements the <xref:System.Collections.IList> interface
See the <xref:System.Windows.Forms.Binding> class overview for more information on data sources.
If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> reference contains more than one table, you must set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property a string that specifies the table to bind to. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify the table to bind to.
Setting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> to an object that does not implement the <xref:System.Collections.IList> interface or an <xref:System.ComponentModel.IListSource> will cause the grid to throw an exception.
You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AddNew%2A> property to `false`.
To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example.
You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name).
## Examples
The following code example shows how to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A>, and when needed, the <xref:System.Windows.Forms.DataGrid.DataMember%2A>, to bind a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to both a <xref:System.Data.DataView> and a <xref:System.Data.DataSet>. The example also shows how to return data sources from the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>.
[!code-cpp[Classic DataGrid.DataSource Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.DataSource Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.DataSource Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.DataMember" />
<altmember cref="T:System.Data.DataSet" />
<altmember cref="T:System.Data.DataViewManager" />
<altmember cref="T:System.Data.DataView" />
</Docs>
</Member>
<Member MemberName="DataSourceChanged">
<MemberSignature Language="C#" Value="public event EventHandler DataSourceChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler DataSourceChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.DataSourceChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event DataSourceChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ DataSourceChanged;" />
<MemberSignature Language="F#" Value="member this.DataSourceChanged : EventHandler " Usage="member this.DataSourceChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> property value has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.DataSourceChanged> event occurs when the <xref:System.Windows.Forms.DataGrid.DataMember%2A> value changes, or when the <xref:System.Windows.Forms.BindingContext> of the <xref:System.Windows.Forms.DataGrid> changes.
## Examples
The following code example demonstrates the use of this member.
[!code-cpp[Classic DataGrid.DataSourceChanged Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.DataSourceChanged Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.DataSourceChanged Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.SetDataBinding(System.Object,System.String)" />
<altmember cref="P:System.Windows.Forms.DataGrid.DataSource" />
<altmember cref="P:System.Windows.Forms.DataGrid.DataMember" />
</Docs>
</Member>
<Member MemberName="DefaultSize">
<MemberSignature Language="C#" Value="protected override System.Drawing.Size DefaultSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size DefaultSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.DefaultSize" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultSize : System.Drawing.Size" Usage="System.Windows.Forms.DataGrid.DefaultSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default size of the control.</summary>
<value>The default size of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="dataGrid.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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>Disposes of the resources (other than memory) used by the <see cref="T:System.Windows.Forms.DataGrid" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call <xref:System.Windows.Forms.DataGrid.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. The <xref:System.Windows.Forms.DataGrid.Dispose%2A> method leaves the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> in an unusable state. After calling <xref:System.Windows.Forms.DataGrid.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> so the memory it was occupying can be reclaimed by garbage collection.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.Dispose%2A> method to free resources.
[!code-vb[Classic DataGrid.Dispose Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Dispose Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EndEdit">
<MemberSignature Language="C#" Value="public bool EndEdit (System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool EndEdit(class System.Windows.Forms.DataGridColumnStyle gridColumn, int32 rowNumber, bool shouldAbort) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.EndEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Function EndEdit (gridColumn As DataGridColumnStyle, rowNumber As Integer, shouldAbort As Boolean) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool EndEdit(System::Windows::Forms::DataGridColumnStyle ^ gridColumn, int rowNumber, bool shouldAbort);" />
<MemberSignature Language="F#" Value="abstract member EndEdit : System.Windows.Forms.DataGridColumnStyle * int * bool -&gt; bool&#xA;override this.EndEdit : System.Windows.Forms.DataGridColumnStyle * int * bool -&gt; bool" Usage="dataGrid.EndEdit (gridColumn, rowNumber, shouldAbort)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Windows.Forms.IDataGridEditingService.EndEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32,System.Boolean)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="gridColumn" Type="System.Windows.Forms.DataGridColumnStyle" />
<Parameter Name="rowNumber" Type="System.Int32" />
<Parameter Name="shouldAbort" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="gridColumn">The <see cref="T:System.Windows.Forms.DataGridColumnStyle" /> to cease editing.</param>
<param name="rowNumber">The number of the row to cease editing.</param>
<param name="shouldAbort">Set to <see langword="true" /> if the current operation should be stopped.</param>
<summary>Requests an end to an edit operation taking place on the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary>
<returns>
<see langword="true" /> if the editing operation ceases; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.EndEdit%2A> method returns `false` if the user is not editing (typing into) a cell.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> and <xref:System.Windows.Forms.DataGrid.EndEdit%2A> methods to edit a value in a grid displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control.
[!code-cpp[Classic DataGrid.EndEdit Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.EndEdit Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.EndEdit Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.BeginEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32)" />
</Docs>
</Member>
<Member MemberName="EndInit">
<MemberSignature Language="C#" Value="public void EndInit ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void EndInit() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.EndInit" />
<MemberSignature Language="VB.NET" Value="Public Sub EndInit ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void EndInit();" />
<MemberSignature Language="F#" Value="abstract member EndInit : unit -&gt; unit&#xA;override this.EndInit : unit -&gt; unit" Usage="dataGrid.EndInit " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ComponentModel.ISupportInitialize.EndInit</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Ends the initialization of a <see cref="T:System.Windows.Forms.DataGrid" /> that is used on a form or used by another component. The initialization occurs at run time.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The Visual Studio design environment uses this method to end the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.BeginInit%2A> method starts the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized.
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.BeginInit" />
</Docs>
</Member>
<Member MemberName="Expand">
<MemberSignature Language="C#" Value="public void Expand (int row);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Expand(int32 row) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.Expand(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub Expand (row As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Expand(int row);" />
<MemberSignature Language="F#" Value="member this.Expand : int -&gt; unit" Usage="dataGrid.Expand row" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="row" Type="System.Int32" />
</Parameters>
<Docs>
<param name="row">The number of the row to expand. If set to -1, all rows are expanded.</param>
<summary>Displays child relations, if any exist, for all rows or a specific row.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the use of this member.
[!code-vb[Classic DataGrid.Expand Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Expand Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.Expand(System.Int32)" />
</Docs>
</Member>
<Member MemberName="FirstVisibleColumn">
<MemberSignature Language="C#" Value="public int FirstVisibleColumn { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 FirstVisibleColumn" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.FirstVisibleColumn" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property FirstVisibleColumn As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int FirstVisibleColumn { int get(); };" />
<MemberSignature Language="F#" Value="member this.FirstVisibleColumn : int" Usage="System.Windows.Forms.DataGrid.FirstVisibleColumn" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the index of the first visible column in a grid.</summary>
<value>The index of a <see cref="T:System.Windows.Forms.DataGridColumnStyle" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A column is considered visible even if it is partially concealed.
If a particular column is not visible, set the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property to the cell that should be visible.
## Examples
The following code example scrolls the grid if the first visible column is greater than five.
[!code-vb[Classic DataGrid.FirstVisibleColumn Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.FirstVisibleColumn Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CurrentCell" />
</Docs>
</Member>
<Member MemberName="FlatMode">
<MemberSignature Language="C#" Value="public bool FlatMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool FlatMode" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.FlatMode" />
<MemberSignature Language="VB.NET" Value="Public Property FlatMode As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool FlatMode { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.FlatMode : bool with get, set" Usage="System.Windows.Forms.DataGrid.FlatMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the grid displays in flat mode.</summary>
<value>
<see langword="true" /> if the grid is displayed flat; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example examines the <xref:System.Windows.Forms.DataGrid.FlatMode%2A> property and notifies the user of its status.
[!code-cpp[MyDataGridClass_FlatMode_ReadOnly#1](~/samples/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp#1)]
[!code-csharp[MyDataGridClass_FlatMode_ReadOnly#1](~/samples/snippets/csharp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CS/mydatagridclass_flatmode_readonly.cs#1)]
[!code-vb[MyDataGridClass_FlatMode_ReadOnly#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FlatModeChanged">
<MemberSignature Language="C#" Value="public event EventHandler FlatModeChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler FlatModeChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.DataGrid.FlatModeChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event FlatModeChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ FlatModeChanged;" />
<MemberSignature Language="F#" Value="member this.FlatModeChanged : EventHandler " Usage="member this.FlatModeChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.FlatMode" /> has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the use of this member.
[!code-cpp[MyDataGridClass_FlatMode_ReadOnly#2](~/samples/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp#2)]
[!code-csharp[MyDataGridClass_FlatMode_ReadOnly#2](~/samples/snippets/csharp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CS/mydatagridclass_flatmode_readonly.cs#2)]
[!code-vb[MyDataGridClass_FlatMode_ReadOnly#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb#2)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.FlatMode" />
</Docs>
</Member>
<Member MemberName="ForeColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color ForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color ForeColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.ForeColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property ForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color ForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.ForeColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.ForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the foreground color (typically the color of the text) property of the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color. The default is <see cref="P:System.Drawing.SystemBrushes.WindowText" /> color.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the use of this member.
[!code-cpp[DataGrid_ColorMembers#2](~/samples/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp#2)]
[!code-csharp[DataGrid_ColorMembers#2](~/samples/snippets/csharp/VS_Snippets_Winforms/DataGrid_ColorMembers/CS/datagrid_10.cs#2)]
[!code-vb[DataGrid_ColorMembers#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="GetCellBounds">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets the <see cref="T:System.Drawing.Rectangle" /> that specifies the four corners of a cell.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetCellBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetCellBounds (System.Windows.Forms.DataGridCell dgc);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetCellBounds(valuetype System.Windows.Forms.DataGridCell dgc) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GetCellBounds(System.Windows.Forms.DataGridCell)" />
<MemberSignature Language="VB.NET" Value="Public Function GetCellBounds (dgc As DataGridCell) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetCellBounds(System::Windows::Forms::DataGridCell dgc);" />
<MemberSignature Language="F#" Value="member this.GetCellBounds : System.Windows.Forms.DataGridCell -&gt; System.Drawing.Rectangle" Usage="dataGrid.GetCellBounds dgc" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dgc" Type="System.Windows.Forms.DataGridCell" />
</Parameters>
<Docs>
<param name="dgc">The <see cref="T:System.Windows.Forms.DataGridCell" /> to look up.</param>
<summary>Gets the <see cref="T:System.Drawing.Rectangle" /> of the cell specified by <see cref="T:System.Windows.Forms.DataGridCell" />.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell.
[!code-cpp[Classic DataGrid.GetCellBounds1 Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.GetCellBounds1 Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.GetCellBounds1 Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.GetCurrentCellBounds" />
</Docs>
</Member>
<Member MemberName="GetCellBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetCellBounds (int row, int col);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetCellBounds(int32 row, int32 col) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GetCellBounds(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function GetCellBounds (row As Integer, col As Integer) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetCellBounds(int row, int col);" />
<MemberSignature Language="F#" Value="member this.GetCellBounds : int * int -&gt; System.Drawing.Rectangle" Usage="dataGrid.GetCellBounds (row, col)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="row" Type="System.Int32" />
<Parameter Name="col" Type="System.Int32" />
</Parameters>
<Docs>
<param name="row">The number of the cell's row.</param>
<param name="col">The number of the cell's column.</param>
<summary>Gets the <see cref="T:System.Drawing.Rectangle" /> of the cell specified by row and column number.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To retrieve the cell bounds for the currently selected cell, use <xref:System.Windows.Forms.DataGrid.GetCurrentCellBounds%2A>.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell.
[!code-cpp[Classic DataGrid.GetCellBounds Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.GetCellBounds Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.GetCellBounds Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.GetCurrentCellBounds" />
<altmember cref="P:System.Windows.Forms.DataGrid.CurrentCell" />
</Docs>
</Member>
<Member MemberName="GetCurrentCellBounds">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetCurrentCellBounds ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetCurrentCellBounds() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GetCurrentCellBounds" />
<MemberSignature Language="VB.NET" Value="Public Function GetCurrentCellBounds () As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetCurrentCellBounds();" />
<MemberSignature Language="F#" Value="member this.GetCurrentCellBounds : unit -&gt; System.Drawing.Rectangle" Usage="dataGrid.GetCurrentCellBounds " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Gets a <see cref="T:System.Drawing.Rectangle" /> that specifies the four corners of the selected cell.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To retrieve the cell bounds for a cell other than the current cell, use <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A>.
## Examples
The following code example gets the <xref:System.Drawing.Rectangle> of the selected cell.
[!code-cpp[Classic DataGrid.GetCurrentCellBounds Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.GetCurrentCellBounds Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.GetCurrentCellBounds Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.GetCellBounds(System.Int32,System.Int32)" />
</Docs>
</Member>
<Member MemberName="GetOutputTextDelimiter">
<MemberSignature Language="C#" Value="protected virtual string GetOutputTextDelimiter ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance string GetOutputTextDelimiter() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GetOutputTextDelimiter" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function GetOutputTextDelimiter () As String" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::String ^ GetOutputTextDelimiter();" />
<MemberSignature Language="F#" Value="abstract member GetOutputTextDelimiter : unit -&gt; string&#xA;override this.GetOutputTextDelimiter : unit -&gt; string" Usage="dataGrid.GetOutputTextDelimiter " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Gets the string that is the delimiter between columns when row contents are copied to the Clipboard.</summary>
<returns>The string value "\t", which represents a tab used to separate columns in a row.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GridHScrolled">
<MemberSignature Language="C#" Value="protected virtual void GridHScrolled (object sender, System.Windows.Forms.ScrollEventArgs se);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void GridHScrolled(object sender, class System.Windows.Forms.ScrollEventArgs se) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GridHScrolled(System.Object,System.Windows.Forms.ScrollEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub GridHScrolled (sender As Object, se As ScrollEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void GridHScrolled(System::Object ^ sender, System::Windows::Forms::ScrollEventArgs ^ se);" />
<MemberSignature Language="F#" Value="abstract member GridHScrolled : obj * System.Windows.Forms.ScrollEventArgs -&gt; unit&#xA;override this.GridHScrolled : obj * System.Windows.Forms.ScrollEventArgs -&gt; unit" Usage="dataGrid.GridHScrolled (sender, se)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="sender" Type="System.Object" />
<Parameter Name="se" Type="System.Windows.Forms.ScrollEventArgs" />
</Parameters>
<Docs>
<param name="sender">An <see cref="T:System.Object" /> that contains data about the control.</param>
<param name="se">A <see cref="T:System.Windows.Forms.ScrollEventArgs" /> that contains the event data.</param>
<summary>Listens for the scroll event of the horizontal scroll bar.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GridLineColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color GridLineColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color GridLineColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.GridLineColor" />
<MemberSignature Language="VB.NET" Value="Public Property GridLineColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color GridLineColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.GridLineColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.GridLineColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the color of the grid lines.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the color of the grid lines. The default is the system color for controls (<see cref="P:System.Drawing.SystemColors.Control" />).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
No grid line is displayed if the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property is set to `DataGridLineStyle.None`.
## Examples
The following code example sets the color of the grid's lines using a value passed to the method.
[!code-cpp[Classic DataGrid.GridLineColor Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.GridLineColor Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.GridLineColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The value is not set.</exception>
<altmember cref="P:System.Windows.Forms.DataGrid.GridLineStyle" />
</Docs>
</Member>
<Member MemberName="GridLineStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGridLineStyle GridLineStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.DataGridLineStyle GridLineStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.GridLineStyle" />
<MemberSignature Language="VB.NET" Value="Public Property GridLineStyle As DataGridLineStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::DataGridLineStyle GridLineStyle { System::Windows::Forms::DataGridLineStyle get(); void set(System::Windows::Forms::DataGridLineStyle value); };" />
<MemberSignature Language="F#" Value="member this.GridLineStyle : System.Windows.Forms.DataGridLineStyle with get, set" Usage="System.Windows.Forms.DataGrid.GridLineStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</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.Windows.Forms.DataGridLineStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the line style of the grid.</summary>
<value>One of the <see cref="T:System.Windows.Forms.DataGridLineStyle" /> values. The default is <see langword="Solid" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example changes the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property to show no lines.
[!code-vb[Classic DataGrid.GridLineStyle Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineStyle Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.GridLineColor" />
</Docs>
</Member>
<Member MemberName="GridVScrolled">
<MemberSignature Language="C#" Value="protected virtual void GridVScrolled (object sender, System.Windows.Forms.ScrollEventArgs se);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void GridVScrolled(object sender, class System.Windows.Forms.ScrollEventArgs se) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.GridVScrolled(System.Object,System.Windows.Forms.ScrollEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub GridVScrolled (sender As Object, se As ScrollEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void GridVScrolled(System::Object ^ sender, System::Windows::Forms::ScrollEventArgs ^ se);" />
<MemberSignature Language="F#" Value="abstract member GridVScrolled : obj * System.Windows.Forms.ScrollEventArgs -&gt; unit&#xA;override this.GridVScrolled : obj * System.Windows.Forms.ScrollEventArgs -&gt; unit" Usage="dataGrid.GridVScrolled (sender, se)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="sender" Type="System.Object" />
<Parameter Name="se" Type="System.Windows.Forms.ScrollEventArgs" />
</Parameters>
<Docs>
<param name="sender">An <see cref="T:System.Object" /> that contains data about the control.</param>
<param name="se">A <see cref="T:System.Windows.Forms.ScrollEventArgs" /> that contains the event data.</param>
<summary>Listens for the scroll event of the vertical scroll bar.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="HeaderBackColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color HeaderBackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color HeaderBackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.HeaderBackColor" />
<MemberSignature Language="VB.NET" Value="Public Property HeaderBackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color HeaderBackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.HeaderBackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.HeaderBackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color of all row and column headers.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the background color of row and column headers. The default is the system color for controls, <see cref="P:System.Drawing.SystemColors.Control" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the background color of column headers using a value passed to the method.
[!code-vb[Classic DataGrid.HeaderBackColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderBackColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">While trying to set the property, a <see langword="Color.Empty" /> was passed.</exception>
<altmember cref="P:System.Windows.Forms.DataGrid.HeaderForeColor" />
<altmember cref="P:System.Windows.Forms.DataGrid.FlatMode" />
</Docs>
</Member>
<Member MemberName="HeaderFont">
<MemberSignature Language="C#" Value="public System.Drawing.Font HeaderFont { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Font HeaderFont" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.HeaderFont" />
<MemberSignature Language="VB.NET" Value="Public Property HeaderFont As Font" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Font ^ HeaderFont { System::Drawing::Font ^ get(); void set(System::Drawing::Font ^ value); };" />
<MemberSignature Language="F#" Value="member this.HeaderFont : System.Drawing.Font with get, set" Usage="System.Windows.Forms.DataGrid.HeaderFont" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Font</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the font used for column headers.</summary>
<value>The <see cref="T:System.Drawing.Font" /> that represents the header text.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="HeaderForeColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color HeaderForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color HeaderForeColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.HeaderForeColor" />
<MemberSignature Language="VB.NET" Value="Public Property HeaderForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color HeaderForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.HeaderForeColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.HeaderForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the foreground color of headers.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the grid's column headers, including the column header text and the plus/minus glyphs. The default is <see cref="P:System.Drawing.SystemColors.ControlText" /> color.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the foreground color of the grid's column headers.
[!code-vb[Classic DataGrid.HeaderForeColor Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderForeColor Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.FlatMode" />
<altmember cref="P:System.Windows.Forms.DataGrid.HeaderBackColor" />
</Docs>
</Member>
<MemberGroup MemberName="HitTest">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets information about the <see cref="T:System.Windows.Forms.DataGrid" /> control at a specified point on the screen.</summary>
</Docs>
</MemberGroup>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGrid.HitTestInfo HitTest (System.Drawing.Point position);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.DataGrid/HitTestInfo HitTest(valuetype System.Drawing.Point position) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.HitTest(System.Drawing.Point)" />
<MemberSignature Language="VB.NET" Value="Public Function HitTest (position As Point) As DataGrid.HitTestInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::DataGrid::HitTestInfo ^ HitTest(System::Drawing::Point position);" />
<MemberSignature Language="F#" Value="member this.HitTest : System.Drawing.Point -&gt; System.Windows.Forms.DataGrid.HitTestInfo" Usage="dataGrid.HitTest position" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGrid+HitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="position" Type="System.Drawing.Point" />
</Parameters>
<Docs>
<param name="position">A <see cref="T:System.Drawing.Point" /> that represents single x,y coordinate.</param>
<summary>Gets information, such as row and column number of a clicked point on the grid, about the grid using a specific <see cref="T:System.Drawing.Point" />.</summary>
<returns>A <see cref="T:System.Windows.Forms.DataGrid.HitTestInfo" /> that contains specific information about the grid.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration.
The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in occurs when a user clicks on a grid.
[!code-vb[Classic DataGrid.HitTest1 Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest1 Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="E:System.Windows.Forms.Control.MouseDown" />
</Docs>
</Member>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.DataGrid.HitTestInfo HitTest (int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.DataGrid/HitTestInfo HitTest(int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.HitTest(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function HitTest (x As Integer, y As Integer) As DataGrid.HitTestInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::DataGrid::HitTestInfo ^ HitTest(int x, int y);" />
<MemberSignature Language="F#" Value="member this.HitTest : int * int -&gt; System.Windows.Forms.DataGrid.HitTestInfo" Usage="dataGrid.HitTest (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DataGrid+HitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" />
<Parameter Name="y" Type="System.Int32" />
</Parameters>
<Docs>
<param name="x">The horizontal position of the coordinate.</param>
<param name="y">The vertical position of the coordinate.</param>
<summary>Gets information, such as row and column number of a clicked point on the grid, using the x and y coordinate passed to the method.</summary>
<returns>A <see cref="T:System.Windows.Forms.DataGrid.HitTestInfo" /> that contains information about the clicked part of the grid.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration.
The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events.
## Examples
The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in an event that occurs when the user clicks in the grid.
[!code-vb[Classic DataGrid.HitTest Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="E:System.Windows.Forms.Control.MouseDown" />
</Docs>
</Member>
<Member MemberName="HorizScrollBar">
<MemberSignature Language="C#" Value="protected System.Windows.Forms.ScrollBar HorizScrollBar { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ScrollBar HorizScrollBar" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.HorizScrollBar" />
<MemberSignature Language="VB.NET" Value="Protected ReadOnly Property HorizScrollBar As ScrollBar" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; property System::Windows::Forms::ScrollBar ^ HorizScrollBar { System::Windows::Forms::ScrollBar ^ get(); };" />
<MemberSignature Language="F#" Value="member this.HorizScrollBar : System.Windows.Forms.ScrollBar" Usage="System.Windows.Forms.DataGrid.HorizScrollBar" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<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.Windows.Forms.ScrollBar</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the horizontal scroll bar for the grid.</summary>
<value>The <see cref="T:System.Windows.Forms.ScrollBar" /> for the grid.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.VertScrollBar" />
</Docs>
</Member>
<Member MemberName="IsExpanded">
<MemberSignature Language="C#" Value="public bool IsExpanded (int rowNumber);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsExpanded(int32 rowNumber) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.IsExpanded(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function IsExpanded (rowNumber As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool IsExpanded(int rowNumber);" />
<MemberSignature Language="F#" Value="member this.IsExpanded : int -&gt; bool" Usage="dataGrid.IsExpanded rowNumber" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowNumber" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowNumber">The number of the row in question.</param>
<summary>Gets a value that indicates whether the node of a specified row is expanded or collapsed.</summary>
<returns>
<see langword="true" /> if the node is expanded; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example tests each row in the grid, and prints the row number of expanded rows.
[!code-cpp[Classic DataGrid.IsExpanded Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.IsExpanded Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.IsExpanded Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.DataGrid.Collapse(System.Int32)" />
</Docs>
</Member>
<Member MemberName="IsSelected">
<MemberSignature Language="C#" Value="public bool IsSelected (int row);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsSelected(int32 row) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.DataGrid.IsSelected(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function IsSelected (row As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool IsSelected(int row);" />
<MemberSignature Language="F#" Value="member this.IsSelected : int -&gt; bool" Usage="dataGrid.IsSelected row" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="row" Type="System.Int32" />
</Parameters>
<Docs>
<param name="row">The number of the row you are interested in.</param>
<summary>Gets a value indicating whether a specified row is selected.</summary>
<returns>
<see langword="true" /> if the row is selected; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method with the <xref:System.Windows.Forms.DataGrid.Select%2A>, <xref:System.Windows.Forms.DataGrid.UnSelect%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row.
## Examples
The following code example demonstrates the use of this member.
[!code-cpp[MyDataGridClass_ResetHeaderBackColor#5](~/samples/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp#5)]
[!code-csharp[MyDataGridClass_ResetHeaderBackColor#5](~/samples/snippets/csharp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CS/mydatagridclass_resetheaderbackcolor.cs#5)]
[!code-vb[MyDataGridClass_ResetHeaderBackColor#5](~/samples/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb#5)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Item">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets or sets the value of a specified cell.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public object this[System.Windows.Forms.DataGridCell cell] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Item(valuetype System.Windows.Forms.DataGridCell)" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.Item(System.Windows.Forms.DataGridCell)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(cell As DataGridCell) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ default[System::Windows::Forms::DataGridCell] { System::Object ^ get(System::Windows::Forms::DataGridCell cell); void set(System::Windows::Forms::DataGridCell cell, System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.Item(System.Windows.Forms.DataGridCell) : obj with get, set" Usage="System.Windows.Forms.DataGrid.Item" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cell" Type="System.Windows.Forms.DataGridCell" />
</Parameters>
<Docs>
<param name="cell">A <see cref="T:System.Windows.Forms.DataGridCell" /> that represents a cell in the grid.</param>
<summary>Gets or sets the value of a specified <see cref="T:System.Windows.Forms.DataGridCell" />.</summary>
<value>The value, typed as <see cref="T:System.Object" />, of the cell.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting this property changes the position of the <xref:System.Data.DataView> to the specified row.
## Examples
The following code example sets and gets the value of a cell by declaring a <xref:System.Windows.Forms.DataGridCell> variable, setting its <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> values, then first changing, then returning, the value of the given cell.
[!code-cpp[Classic DataGrid.this1 Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this1 Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.this1 Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.this1 Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.this1 Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this1 Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.DataGrid.CurrentCell" />
<altmember cref="T:System.Windows.Forms.DataGridCell" />
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public object this[int rowIndex, int columnIndex] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Item(int32, int32)" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.Item(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(rowIndex As Integer, columnIndex As Integer) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ default[int, int] { System::Object ^ get(int rowIndex, int columnIndex); void set(int rowIndex, int columnIndex, System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.Item(int * int) : obj with get, set" Usage="System.Windows.Forms.DataGrid.Item" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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="columnIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rowIndex">The zero-based index of the row containing the value.</param>
<param name="columnIndex">The zero-based index of the column containing the value.</param>
<summary>Gets or sets the value of the cell at the specified the row and column.</summary>
<value>The value, typed as <see cref="T:System.Object" />, of the cell.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting this property changes the position of the <xref:System.Data.DataView> to the specified row.
## Examples
The following code example prints the value contained by the cell at the specified row and index.
[!code-cpp[Classic DataGrid.this Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this Example/CPP/source.cpp#1)]
[!code-csharp[Classic DataGrid.this Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic DataGrid.this Example/CS/source.cs#1)]
[!code-vb[Classic DataGrid.this Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">While getting or setting, the <paramref name="rowIndex" /> is out of range.
While getting or setting, the <paramref name="columnIndex" /> is out of range.</exception>
</Docs>
</Member>
<Member MemberName="LinkColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color LinkColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color LinkColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.DataGrid.LinkColor" />
<MemberSignature Language="VB.NET" Value="Public Property LinkColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color LinkColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.LinkColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.DataGrid.LinkColor" />
<MemberType>Property</MemberType>