System.Windows.Forms.DataGridViewColumn.DataPropertyName Property

Gets or sets the name of the data source property or database column to which the System.Windows.Forms.DataGridViewColumn is bound.

Syntax

[System.ComponentModel.TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Editor("System.Windows.Forms.Design.DataGridViewColumnDataPropertyNameEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Browsable(true)]
public string DataPropertyName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the DataGridView.AutoGenerateColumns property is set to true, each column automatically sets its DataGridViewColumn.DataPropertyName property to the name of a property or database column in the data source specified by the DataGridView.DataSource property. This binding can also be performed manually, which is useful when you want to display only a subset of the properties or database columns available in the data source. In such cases, set the DataGridView.AutoGenerateColumns property to false, and then manually add each System.Windows.Forms.DataGridViewColumn, setting the value of each DataGridViewColumn.DataPropertyName property to the properties or database columns in the data source that you want to display.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0