Dynamicweb 8 Documentation
PropertyProductValueCollection Class
Members  Example 

Represents a collection of PropertyProductValue objects.
Object Model
PropertyProductValueCollection ClassPropertyProductValue Class
Syntax
Example
class MyPage : System.Web.UI.Page
{
    public void RenderFieldGroups(Product product, Dynamicweb.Rendering.Template template)
    {
        PropertyProductValueCollection propertyValues = PropertyProductValue.getPropertyProductValues(product);

        //Get types, groups, and fields from valueCollection
        Dictionary<string, object> typeIDs = new Dictionary<string, object>();           
        Dictionary<string, string> propertyValueDictionary = new Dictionary<string, string>();

        foreach (PropertyProductValue propertyValue in propertyValues)
        {
            //Type
            if (!typeIDs.ContainsKey(propertyValue.TypeID))
            {
                typeIDs.Add(propertyValue.TypeID, null);
            }

            //Dictionary containing link between field and value
            if (!propertyValueDictionary.ContainsKey(propertyValue.FieldID))
            {
                propertyValueDictionary.Add(propertyValue.FieldID, propertyValue.Value);
            }
        }

        PropertyTypeCollection propertyTypes = PropertyType.getPropertyTypes(typeIDs.Keys);

        //Render all the values without loops
        RenderGroupFieldsValues(propertyTypes, propertyValueDictionary, template);

        //Render all the values inside 3x loops (type, group, field)
        RenderGroupFieldTypes(propertyTypes, propertyValueDictionary, template);
    }

    private void RenderGroupFieldsValues(Dynamicweb.eCommerce.Products.PropertyTypeCollection Types, Dictionary<string, string> propertyValueDictionary, Dynamicweb.Rendering.Template ParentTemplate)
    {
        //TODO: insert your code here
    }
    private void RenderGroupFieldTypes(Dynamicweb.eCommerce.Products.PropertyTypeCollection Types, Dictionary<string, string> propertyValueDictionary, Dynamicweb.Rendering.Template ParentTemplate)
    {
        //TODO: insert your code here
    }
}
Inheritance Hierarchy

System.Object
   System.Collections.ObjectModel.Collection<T>
      Dynamicweb.eCommerce.Products.PropertyProductValueCollection

Requirements

Target Platforms: 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

Reference

PropertyProductValueCollection Members
Dynamicweb.eCommerce.Products Namespace

Send Feedback