Dynamicweb 8 Documentation
RemoveVariantGroup Method
Example 

The VariantGroup object.
Removes the variant group by object reference.
Syntax
'Declaration
 
Public Sub RemoveVariantGroup( _ 
   ByVal variantGroup As VariantGroup _ 
) 
public void RemoveVariantGroup( 
   VariantGroup variantGroup 
)

Parameters

variantGroup
The VariantGroup object.
Example
class MyPage : System.Web.UI.Page
{
   private void DelVariantGrpProdRelated()
   {
       Product prod = new Product();
       prod = (Product)Session["Ecom.Backend.Product"];

       string varGrpID = HttpContext.Current.Request.QueryString["grpArr"];

       Dynamicweb.eCommerce.Variants.VariantGroup variantGrp = Dynamicweb.eCommerce.Variants.VariantGroup.Create(varGrpID);
       prod.RemoveVariantGroup(variantGrp);

       Dynamicweb.eCommerce.Variants.VariantGroupProductRelation vgpr = new Dynamicweb.eCommerce.Variants.VariantGroupProductRelation();
       vgpr.Delete(prod.ID, varGrpID);
 
       Dynamicweb.eCommerce.Variants.VariantCombination vopr = new Dynamicweb.eCommerce.Variants.VariantCombination();
       vopr.Delete(prod.ID);

       prod.VariantGroups = null;
       prod.VariantCombinations = null;
   }
}
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

Product Class
Product Members

Send Feedback