protected void ProductComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { var criteria = new ProductSearchCriteria(); criteria.Keyword = e.Text; var products = HccApp.CatalogServices.Products.FindByCriteria(criteria); ProductComboBox.Items.Clear(); ProductComboBox.DataSource = products; ProductComboBox.DataTextField = "ProductName"; ProductComboBox.DataValueField = "UrlSlug"; ProductComboBox.DataBind(); ProductComboBox.Items.Insert(0, new RadComboBoxItem(LocalizeString("NoneSelectedText"), string.Empty)); }
protected void BindProducts() { //TODO: Restore auto-complete functionality /* * var criteria = new ProductSearchCriteria(); * criteria.Keyword = e.Text; * * var products = HccApp.CatalogServices.Products.FindByCriteria(criteria); */ // only getting the first 500 for now (until the TODO above is done) var products = HccApp.CatalogServices.Products.FindAllPaged(0, 500); ProductComboBox.Items.Clear(); ProductComboBox.DataSource = products; ProductComboBox.DataTextField = "ProductName"; ProductComboBox.DataValueField = "UrlSlug"; ProductComboBox.DataBind(); ProductComboBox.Items.Insert(0, new ListItem(LocalizeString("NoneSelectedText"), string.Empty)); }