Пример #1
0
    /// <summary>
    /// Bind product to the drop down list
    /// </summary>
    public void BindProductNames()
    {
        //Bind Drop down list
        ProductAdmin productAdmin = new ProductAdmin();
        TList<Product> productList = productAdmin.GetAllProducts(ZNodeConfigManager.SiteConfig.PortalID);
        productList.Sort("Name");
        ddlProductNames.DataSource = productList;
        ddlProductNames.DataTextField = "Name";
        ddlProductNames.DataValueField = "ProductId";
        ddlProductNames.DataBind();

        ListItem li = new ListItem("All","0");
        li.Selected = true;
        ddlProductNames.Items.Insert(0, li);
    }