Version

DataValue Property

Returns or sets the data value associated with this item.
Syntax
'Declaration
 
Public Property DataValue As Object
public object DataValue {get; set;}
Remarks

This property, in conjunction with the DisplayText property, provides a way to store one value in the datasource while displaying another. In this manner, the user can be presented with a list of states, for example, and if he or she selects "New York," the value "NY" could be stored in the data source. In this example, "New York" is the value of the DisplayText property while "NY" is the value of the DataValue property.

When data from the data source matches the data value for a particular valuelistitem, that valuelistitem's display text will be shown in the cell.

Values for this property do not have to be unique within the ValueListItems collection.

The Find method can be invoked to search for a valuelistitem by its data value.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also