Dynamicweb 8 Documentation
GroupRelationCollection Class
Members  Example 

Collection class for parent-child relations between product groups
Object Model
GroupRelationCollection ClassGroupRelation Class
Syntax
Example
class MyPage : System.Web.UI.Page
{
   private void SaveGroupRelations(Group grp)
   {
       // using additioal collection - to save sorting order
       // load group relations
       GroupRelationCollection relationsList = new GroupRelationCollection();
       for (int i = 0; i <= int.MaxValue; i++)
       {
           string pId = Request["GRPREL_ID" + i];
           if (string.IsNullOrEmpty(pId))
               break;

           GroupRelation g = new GroupRelation(grp.ID, pId);
           g.ID = grp.ID;
           g.ParentID = pId;

           relationsList.Add(g);
       }

       // remove all relations
       GroupRelation grpRelDel = new GroupRelation();
       grpRelDel.Delete(grp.ID);

       // save loaded relations
       foreach (GroupRelation g in relationsList)
       {
           g.Save(g.ID, g.ParentID);
       }
   }
}
Inheritance Hierarchy

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

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

GroupRelationCollection Members
Dynamicweb.eCommerce.Products Namespace

Send Feedback