Intersoft WebCombo Documentation
DataValueField Property
See Also  Example Send Feedback
ISNet.WebUI.WebCombo Namespace > WebCombo Class : DataValueField Property






Returns or sets the field used as the value in WebCombo control. Returns or sets the field used as the value in WebCombo control.

Syntax

Visual Basic (Declaration) 
<NotifyParentPropertyAttribute(True)>
<DescriptionAttribute("Returns or sets the field used as the value in WebCombo control.")>
<DefaultValueAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
<ISNet.Serialization.XmlSerializableAttribute()>
<CategoryAttribute("Data")>
Public Property DataValueField As String
Visual Basic (Usage)Copy Code
Dim instance As WebCombo
Dim value As String
 
instance.DataValueField = value
 
value = instance.DataValueField
C# 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Returns or sets the field used as the value in WebCombo control.")]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[ISNet.Serialization.XmlSerializableAttribute()]
[CategoryAttribute("Data")]
public string DataValueField {get; set;}
Delphi 
public read-write property DataValueField: String; 
JScript 
NotifyParentPropertyAttribute()
DescriptionAttribute("Returns or sets the field used as the value in WebCombo control.")
DefaultValueAttribute()
ISNet.Serialization.BinarySerializableAttribute()
ISNet.Serialization.XmlSerializableAttribute()
CategoryAttribute("Data")
public function get,set DataValueField : String
Managed Extensions for C++ 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Returns or sets the field used as the value in WebCombo control.")]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[ISNet.Serialization.XmlSerializableAttribute()]
[CategoryAttribute("Data")]
public: __property string* get_DataValueField();
public: __property void set_DataValueField( 
   string* value
);
C++/CLI 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Returns or sets the field used as the value in WebCombo control.")]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[ISNet.Serialization.XmlSerializableAttribute()]
[CategoryAttribute("Data")]
public:
property String^ DataValueField {
   String^ get();
   void set (    String^ value);
}

Example

 

The following example shows you to bind data source to a WebCombo (using old databinding mode) and configure the DataValueField programmatically.
C#Copy Code
private void WebCombo1_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)
{
    DataSet ds = new DataSet();
    oleDbDataAdapter1.Fill(ds,"Employees");
    e.DataSource =  ds;
    WebCombo1.DataTextField = "LastName";
    WebCombo1.DataValueField = "EmployeeID";
}

Remarks

DataValueField is a required property in WebCombo control. The control will use the field specified in this property as the value in WebCombo.

DataValueField can be configured in WebCombo Designer. Alternatively, you can configure it programmatically under InitializeDataSource or InitializeLayout (please look at example above). 

DataValueField is a required property in WebCombo control. The control will use the field specified in this property as the value in WebCombo.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.