Permalink
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (39 sloc) 2.68 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
How to: Manipulate Columns in the Windows Forms DataGridView Control
03/30/2017
.net-framework
dotnet-winforms
article
jsharp
DataGridView control [Windows Forms], manipulatiing columns
columns [Windows Forms], manipulating
data grids, manipulating columns
d8cfe6b3-bbab-4182-bec2-0517d9f1eaf6
9
dotnet-bot
dotnetcontent
wpickett

How to: Manipulate Columns in the Windows Forms DataGridView Control

The following code example shows the various ways to manipulate xref:System.Windows.Forms.DataGridView columns using properties of the xref:System.Windows.Forms.DataGridViewColumn class.

Example

[!code-cppSystem.Windows.Forms.DataGridView.ButtonDemos#100] [!code-csharpSystem.Windows.Forms.DataGridView.ButtonDemos#100] [!code-vbSystem.Windows.Forms.DataGridView.ButtonDemos#100]

Compiling the Code

This example requires:

  • References to the System, System.Drawing, and System.Windows.Forms assemblies.

For information about building this example from the command line for [!INCLUDEvbprvb] or [!INCLUDEcsprcs], see Building from the Command Line or Command-line Building With csc.exe. You can also build this example in [!INCLUDEvsprvs] by pasting the code into a new project. Also see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.

See Also

xref:System.Windows.Forms.DataGridView
xref:System.Windows.Forms.DataGridViewBand
xref:System.Windows.Forms.DataGridViewRow
xref:System.Windows.Forms.DataGridViewColumn
Programming with Cells, Rows, and Columns in the Windows Forms DataGridView Control