protected void cmb_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ListEditItemsRequestedByFilterConditionEventArgs e) { XPCollection <MyObject> collection = new XPCollection <MyObject>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; collection.Criteria = new FunctionOperator("Like", new OperandProperty("Title"), new OperandValue(String.Format("%{0}%", e.Filter))); collection.Sorting.Add(new SortProperty("Oid", DevExpress.Xpo.DB.SortingDirection.Ascending)); cmb.DataSource = collection; cmb.DataBindItems(); }
void dropDown_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ListEditItemsRequestedByFilterConditionEventArgs e) { if (String.IsNullOrEmpty(e.Filter) || e.Filter.Length < NUMBER_CHAR_SEARCH) { return; } DevExpress.Web.ASPxComboBox editor = source as DevExpress.Web.ASPxComboBox; //editor.Items.Clear(); //IList ds = GetLookupSource(e.Filter); //for(int i = e.BeginIndex; i < Math.Min(e.EndIndex + 1, ds.Count); i++) { // editor.Items.Add(Helper.GetEscapedDisplayText(ds[i], EmptyValue, DisplayFormat), Helper.GetObjectKey(ds[i])); //} editor.DataSource = GetLookupSource(e.Filter); editor.DataBind(); }