---
title: "DataGridView Control Code Directory"
ms.date: "03/30/2017"
helpviewer_keywords: 
  - "data grids [Windows Forms], examples"
  - "examples [Windows Forms], DataGridView control"
  - "DataGridView control [Windows Forms], examples"
  - "DataGridView control [Windows Forms], code directory"
ms.assetid: ea8bd66a-5ed6-491b-b9da-63873e275a0a
---
# DataGridView Control Code Directory (Windows Forms)
This topic provides links to <xref:System.Windows.Forms.DataGridView>-related code examples available in the documentation.  
  
> [!NOTE]
> A link always jumps to the top of the topic in which the code example is found.  
  
 Additional code examples are available in the class library reference documentation. For a list of the principal classes and interfaces associated with the <xref:System.Windows.Forms.DataGridView> control, see the table in [DataGridView Control Technology Summary](datagridview-control-technology-summary-windows-forms.md).  
  
## CodeList  
  
## Unbound Data Examples  
  
- [How to: Add an Unbound Column to a Data-Bound Windows Forms DataGridView Control](unbound-column-to-a-data-bound-datagridview.md)  
  
- [How to: Create an Unbound Windows Forms DataGridView Control](how-to-create-an-unbound-windows-forms-datagridview-control.md)  
  
- [Walkthrough: Creating an Unbound Windows Forms DataGridView Control](walkthrough-creating-an-unbound-windows-forms-datagridview-control.md)  
  
## Data Binding Examples  
  
- [How to: Bind Data to the Windows Forms DataGridView Control](how-to-bind-data-to-the-windows-forms-datagridview-control.md)  
  
- [How to: Autogenerate Columns in a Data-Bound Windows Forms DataGridView Control](autogenerate-columns-in-a-data-bound-wf-datagridview-control.md)  
  
- [How to: Remove Autogenerated Columns from a Windows Forms DataGridView Control](remove-autogenerated-columns-from-a-wf-datagridview-control.md)  
  
- [How to: Bind Objects to Windows Forms DataGridView Controls](how-to-bind-objects-to-windows-forms-datagridview-controls.md)  
  
- [How to: Access Objects Bound to Windows Forms DataGridView Rows](how-to-access-objects-bound-to-windows-forms-datagridview-rows.md)  
  
- [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](create-a-master-detail-form-using-two-datagridviews.md)  
  
- [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](creating-a-master-detail-form-using-two-datagridviews.md)  
  
## Data Formatting Examples  
  
- [How to: Format Data in the Windows Forms DataGridView Control](how-to-format-data-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Customize Data Formatting in the Windows Forms DataGridView Control](how-to-customize-data-formatting-in-the-windows-forms-datagridview-control.md)  
  
## Data Validation Examples  
  
- [How to: Validate Data in the Windows Forms DataGridView Control](how-to-validate-data-in-the-windows-forms-datagridview-control.md)  
  
- [Walkthrough: Validating Data in the Windows Forms DataGridView Control](walkthrough-validating-data-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Handle Errors That Occur During Data Entry in the Windows Forms DataGridView Control](handle-errors-that-occur-during-data-entry-in-the-datagrid.md)  
  
- [Walkthrough: Handling Errors that Occur During Data Entry in the Windows Forms DataGridView Control](handling-errors-that-occur-during-data-entry-in-the-datagrid.md)  
  
## Appearance Customization Examples  
  
- [How to: Change the Border and Gridline Styles in the Windows Forms DataGridView Control](change-the-border-and-gridline-styles-in-the-datagrid.md)  
  
- [How to: Set Font and Color Styles in the Windows Forms DataGridView Control](how-to-set-font-and-color-styles-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Set Default Cell Styles for the Windows Forms DataGridView Control](how-to-set-default-cell-styles-for-the-windows-forms-datagridview-control.md)  
  
- [How to: Use the Row Template to Customize Rows in the Windows Forms DataGridView Control](use-the-row-template-to-customize-rows-in-the-datagrid.md)  
  
- [How to: Set Alternating Row Styles for the Windows Forms DataGridView Control](how-to-set-alternating-row-styles-for-the-windows-forms-datagridview-control.md)  
  
## Behavior Customization Examples  
  
- [How to: Specify the Edit Mode for the Windows Forms DataGridView Control](how-to-specify-the-edit-mode-for-the-windows-forms-datagridview-control.md)  
  
- [How to: Specify Default Values for New Rows in the Windows Forms DataGridView Control](specify-default-values-for-new-rows-in-the-datagrid.md)  
  
- [How to: Prevent Row Addition and Deletion in the Windows Forms DataGridView Control](prevent-row-addition-and-deletion-datagridview.md)  
  
- [How to: Perform a Custom Action Based on Changes in a Cell of a Windows Forms DataGridView Control](perform-a-custom-action-based-on-changes-in-a-cell-of-a-datagrid.md)  
  
- [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview.md)  
  
- [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](add-tooltips-to-individual-cells-in-a-wf-datagridview-control.md)  
  
- [How to: Display Images in Cells of the Windows Forms DataGridView Control](how-to-display-images-in-cells-of-the-windows-forms-datagridview-control.md)  
  
- [How to: Customize Sorting in the Windows Forms DataGridView Control](how-to-customize-sorting-in-the-windows-forms-datagridview-control.md)  
  
## Column Manipulation Examples  
  
- [How to: Freeze Columns in the Windows Forms DataGridView Control](how-to-freeze-columns-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Enable Column Reordering in the Windows Forms DataGridView Control](how-to-enable-column-reordering-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Change the Order of Columns in the Windows Forms DataGridView Control](how-to-change-the-order-of-columns-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Hide Columns in the Windows Forms DataGridView Control](how-to-hide-columns-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Hide Column Headers in the Windows Forms DataGridView Control](how-to-hide-column-headers-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Make Columns Read-Only in the Windows Forms DataGridView Control](how-to-make-columns-read-only-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Set the Sort Modes for Columns in the Windows Forms DataGridView Control](set-the-sort-modes-for-columns-wf-datagridview-control.md)  
  
- [How to: Work with Image Columns in the Windows Forms DataGridView Control](how-to-work-with-image-columns-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Manipulate Columns in the Windows Forms DataGridView Control](how-to-manipulate-columns-in-the-windows-forms-datagridview-control.md)  
  
## Row and Column Sizing Examples  
  
- [Column Fill Mode in the Windows Forms DataGridView Control](column-fill-mode-in-the-windows-forms-datagridview-control.md)  
  
- [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control.md)  
  
- [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](programmatically-resize-cells-to-fit-content-in-the-datagrid.md)  
  
- [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](automatically-resize-cells-when-content-changes-in-the-datagrid.md)  
  
## Selection Examples  
  
- [How to: Set the Selection Mode of the Windows Forms DataGridView Control](how-to-set-the-selection-mode-of-the-windows-forms-datagridview-control.md)  
  
- [How to: Get the Selected Cells, Rows, and Columns in the Windows Forms DataGridView Control](selected-cells-rows-and-columns-datagridview.md)  
  
- [How to: Get and Set the Current Cell in the Windows Forms DataGridView Control](get-and-set-the-current-cell-wf-datagridview-control.md)  
  
## Advanced Customization Examples  
  
- [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](customize-the-appearance-of-cells-in-the-datagrid.md)  
  
- [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](customize-the-appearance-of-rows-in-the-datagrid.md)  
  
- [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](customize-cells-and-columns-in-the-datagrid-by-extending-behavior.md)  
  
- [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](disable-buttons-in-a-button-column-in-the-datagrid.md)  
  
- [How to: Host Controls in Windows Forms DataGridView Cells](how-to-host-controls-in-windows-forms-datagridview-cells.md)  
  
## Advanced Data Examples  
  
- [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control.md)  
  
- [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](implementing-virtual-mode-wf-datagridview-control.md)  
  
- [Implementing Virtual Mode with Just-In-Time Data Loading in the Windows Forms DataGridView Control](implementing-virtual-mode-jit-data-loading-in-the-datagrid.md)  
  
## See also

- <xref:System.Windows.Forms.DataGridView>
- [DataGridView Control Overview](datagridview-control-overview-windows-forms.md)
