DataGridViewColumn.Name Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the name of the column.

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

member Name : string with get, set

Property Value

Type: System.String

A String that contains the name of the column. The default is an empty string ("").

This property represents a formal name associated with the column that can be used to identify the column in a collection. For example, the Remove and Contains methods of the DataGridViewColumnCollection class use the Name property. The name is case-insensitive. The DataGridView will treat column1 and COLUMN1 as the same column.

The following code example shows how to set the column name.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top