void prepareVendorList()
        {
            string sqlstr = "select '' as vendor_id,  '' as vendor_name ";

            sqlstr += " union( ";
            sqlstr += " select vendor_id, vendor_name from vendor) ";
            sqlstr += " order by vendor_id ";
            VendorList.DataSource = mydb.GetDataTable(sqlstr);
            VendorList.DataBind();
        }
        private void BindVendors()
        {
            IList <Vendor> vendors = VendorDataSource.LoadAll("Name");
            int            index   = vendors.IndexOf(_VendorId);

            if (index > -1)
            {
                vendors.RemoveAt(index);
            }
            VendorList.DataSource = vendors;
            VendorList.DataBind();
        }
        private void LoadSearchFilter()
        {
            ProductFilter criteria = Session["ProductSearchFilter"] as ProductFilter;

            if (criteria != null)
            {
                Name.Text = criteria.Name;
                SearchDescriptions.Checked = criteria.SearchDescriptions;
                Sku.Text = criteria.Sku;
                ListItem selectedItem = null;

                if (!_DisplayCategorySearch)
                {
                    CategoriesList.DataBind();
                    selectedItem = CategoriesList.Items.FindByValue(criteria.CategoryId.ToString());
                    if (selectedItem != null)
                    {
                        CategoriesList.SelectedIndex = CategoriesList.Items.IndexOf(selectedItem);
                    }
                }
                else
                {
                    Category selectedCategory = CategoryDataSource.Load(criteria.CategoryId);
                    if (selectedCategory != null)
                    {
                        CategoryAutoComplete.Text = selectedCategory.Name;
                    }
                    HiddenSelectedCategoryId.Value = criteria.CategoryId.ToString();
                }

                ManufacturerList.DataBind();
                selectedItem = ManufacturerList.Items.FindByValue(criteria.ManufacturerId.ToString());
                if (selectedItem != null)
                {
                    ManufacturerList.SelectedIndex = ManufacturerList.Items.IndexOf(selectedItem);
                }

                VendorList.DataBind();
                selectedItem = VendorList.Items.FindByValue(criteria.VendorId.ToString());
                if (selectedItem != null)
                {
                    VendorList.SelectedIndex = VendorList.Items.IndexOf(selectedItem);
                }

                ProductGroups.DataBind();
                selectedItem = ProductGroups.Items.FindByValue(criteria.GroupId.ToString());
                if (selectedItem != null)
                {
                    ProductGroups.SelectedIndex = ProductGroups.Items.IndexOf(selectedItem);
                }

                OnlyFeatured.Checked = criteria.Featured == BitFieldState.True;
                FromPrice.Text       = criteria.FromPrice.ToString();
                ToPrice.Text         = criteria.ToPrice.ToString();

                OnlyDigitalGoods.Checked      = criteria.DigitalGoodsOnly;
                OnlyGiftCertificates.Checked  = criteria.GiftCertificatesOnly;
                OnlyKits.Checked              = criteria.KitsOnly;
                OnlySubscriptions.Checked     = criteria.SubscriptionsOnly;
                ShowProductThumbnails.Checked = criteria.IncludeThumbnails;
            }
        }