Dynamicweb 8 Documentation
PropertyGroup Class
Members  Example 

Represents information about properties of groups.
Object Model
PropertyGroup ClassPropertyFieldCollection ClassPropertyField Class
Syntax
'Declaration
 
<SerializableAttribute()> 
Public Class PropertyGroup 
[SerializableAttribute()] 
public class PropertyGroup 
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
   Dynamicweb.eCommerce.Products.PropertyGroup

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

PropertyGroup Members
Dynamicweb.eCommerce.Products Namespace

Send Feedback