PropertyName Property

Binding.PropertyName Property

Gets or sets the name of the control's data-bound property.

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

public string PropertyName { get; }

Property Value

Type: System.String
The name of a control property to bind to.

Use the PropertyName to specify the control property that you want to bind to a list in a data source. Most commonly, you bind a display property such as the Text property of a TextBox control. However, because you can bind any property of a control, you can programmatically create controls at run time using data from a database.

The following code example prints the PropertyName value of each Binding for each control on a form.

private void PrintPropertyNameAndIsBinding()
   foreach(Control thisControl in this.Controls)
      foreach(Binding thisBinding in thisControl.DataBindings)
         Console.WriteLine("\n" + thisControl.ToString());
         // Print the PropertyName value for each binding.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2016 Microsoft