Binding::PropertyName Property
.NET Framework (current version)
Gets or sets the name of the control's data-bound property.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
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() { for each ( Control^ thisControl in this->Controls) { for each ( Binding^ thisBinding in thisControl->DataBindings ) { Console::WriteLine( "\n {0}", thisControl ); // Print the PropertyName value for each binding. Console::WriteLine( thisBinding->PropertyName ); } } }
.NET Framework
Available since 1.1
Available since 1.1
Show: