ValueMember Property

ListControl.ValueMember Property

 

Gets or sets the path of the property to use as the actual value for the items in the ListControl.

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

member ValueMember : string with get, set

Property Value

Type: System.String

A String representing a single property name of the DataSource property value, or a hierarchy of period-delimited property names that resolves to a property name of the final data-bound object. The default is an empty string ("").

Exception Condition
ArgumentException

The specified property path cannot be resolved through the object specified by the DataSource property.

Specify the contents of the ValueMember property in cases where you bind data.

You can clear the ValueMember property by setting the property to an empty string ("") or null.

Setting a new ValueMember property raises the ValueMemberChanged and SelectedValueChanged events.

The following code example shows loading the data into an ArrayList and setting the ValueMember to a property of the object in the list.

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft