Intersoft WebGrid Documentation
ValueList Property
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGridColumn Class : ValueList Property






Gets or sets the WebValueList object of the column.

Syntax

Visual Basic (Declaration) 
<PersistenceModeAttribute(PersistenceMode.InnerProperty)>
<ISNet.Serialization.XmlSerializableAttribute(True)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)>
<DescriptionAttribute("Gets or sets the WebValueList object of the column.")>
<ISNet.Serialization.BinarySerializableAttribute()>
<DefaultValueAttribute()>
<NotifyParentPropertyAttribute(True)>
<TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")>
Public Property ValueList As WebValueList
Visual Basic (Usage)Copy Code
Dim instance As WebGridColumn
Dim value As WebValueList
 
instance.ValueList = value
 
value = instance.ValueList
C# 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[ISNet.Serialization.XmlSerializableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]
[DescriptionAttribute("Gets or sets the WebValueList object of the column.")]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public WebValueList ValueList {get; set;}
Delphi 
public read-write property ValueList: WebValueList; 
JScript 
PersistenceModeAttribute(PersistenceMode.InnerProperty)
ISNet.Serialization.XmlSerializableAttribute()
DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)
DescriptionAttribute("Gets or sets the WebValueList object of the column.")
ISNet.Serialization.BinarySerializableAttribute()
DefaultValueAttribute()
NotifyParentPropertyAttribute()
TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
public function get,set ValueList : WebValueList
Managed Extensions for C++ 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[ISNet.Serialization.XmlSerializableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]
[DescriptionAttribute("Gets or sets the WebValueList object of the column.")]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public: __property WebValueList* get_ValueList();
public: __property void set_ValueList( 
   WebValueList* value
);
C++/CLI 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[ISNet.Serialization.XmlSerializableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]
[DescriptionAttribute("Gets or sets the WebValueList object of the column.")]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public:
property WebValueList^ ValueList {
   WebValueList^ get();
   void set (    WebValueList^ value);
}

Example

The following codes respond to the InitializeLayout event which is fired when the layout of WebGrid is being initialized and about to be rendered. The codes show you that the htShipVia's WebValueList is bound to a HashTable object that contains predefined valuelist items. The vlProd utilizes that automated data caching feature which is also implemented by the WebValueList class. The vlProd is bound to the Products table and let the WebGrid performs value to text translation via its DataTextField and DataValueField definition.
C#Copy Code
protected void WebGrid1_InitLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e) 
{
    // set valuelist for ShipVia
    WebValueList vlShipVia =
        WebGrid1.GetTableByName("Orders").Columns.GetNamedItem("ShipVia").ValueList;
    Hashtable htShipVia = new Hashtable();
    htShipVia.Add("1", "Speedy Express");
    htShipVia.Add("2", "United Package");
    htShipVia.Add("3", "Federal Shipping");
    vlShipVia.DataSource = htShipVia;
    
    // set valuelist for Products
    WebValueList vlProd =
        WebGrid1.GetTableByName("Order Details").Columns.GetNamedItem("ProductID").ValueList;
    
    if (!vlProd.IsDataCached()) 
    {
        daProducts.Fill(dsNorthWind1.Products);
        vlProd.DataSource = dsNorthWind1;
    }
    
    vlProd.DataMember = "Products";
    vlProd.DataTextField = "ProductName";
    vlProd.DataValueField = "ProductID";
}

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.