Export (0) Print
Expand All

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 ("").

ExceptionCondition
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 a null reference (Nothing in Visual Basic).

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

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft