Dynamicweb 8 Documentation
PropertyFieldCollection Class
Members  Example 

Represents a collection of PropertyField objects.
Object Model
PropertyFieldCollection ClassPropertyField Class
Syntax
Example
class MyPage : System.Web.UI.Page
{
    public void RenderGroupFieldGroups(Dynamicweb.eCommerce.Products.PropertyGroupCollection propertyGroups, Dictionary<string, string> fieldValueDictionary, Dynamicweb.Rendering.Template ParentTemplate)
    {
        if (!ParentTemplate.LoopExists("Groups"))
        {
            return;
        }
        Dynamicweb.Rendering.Template PropertyGroupTemplate = ParentTemplate.GetLoop("Groups");

        foreach (PropertyGroup @group in propertyGroups)
        {
            PropertyGroupTemplate.SetTag("Ecom:Product:GroupField.Group.ID", @group.ID);
            PropertyGroupTemplate.SetTag("Ecom:Product:GroupField.Group.Name", @group.Name);
            RenderGroupFieldFields(@group.PropertyFields, fieldValueDictionary, PropertyGroupTemplate);
            PropertyGroupTemplate.CommitLoop();
        }
    }

    public void RenderGroupFieldFields(Dynamicweb.eCommerce.Products.PropertyFieldCollection PropertyFields, Dictionary<string, string> fieldValueDictionary, Dynamicweb.Rendering.Template ParentTemplate)
    {
        if (!ParentTemplate.LoopExists("Fields"))
        {
            return;
        }

        Dynamicweb.Rendering.Template propertyFieldTemplate = ParentTemplate.GetLoop("Fields");
        foreach (PropertyField field in PropertyFields)
        {
            propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.ID", field.ID);
            propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Name", field.Label);
            if (field.InputType == Base.ChkInteger(PropertyField.InputTypeEnum.Dato).ToString() || field.InputType == Base.ChkInteger(PropertyField.InputTypeEnum.Datotid).ToString())
            {
                propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Value", DateTime.FromBinary(Base.ChkLong(fieldValueDictionary[field.ID])), Base.GetCulture(true));
            }
            else
            {
                propertyFieldTemplate.SetTag("Ecom:Product:GroupField.Field.Value", fieldValueDictionary[field.ID]);
            }
            propertyFieldTemplate.CommitLoop();
        }
    }
}
Inheritance Hierarchy

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

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

PropertyFieldCollection Members
Dynamicweb.eCommerce.Products Namespace

Send Feedback