public static void GetRowValues(GridViewCustomBindingGetRowValuesArgs e) { if (e.KeyValues.Count() == 0) { e.RowValues = Model.Where(c => object.Equals(c.OrderID, -1)); } else { var list = new List <Order>(); foreach (var item in e.KeyValues) { list.Add(Model.Where(c => object.Equals(c.OrderID, item)).FirstOrDefault()); } e.RowValues = list; } }
public virtual void GetGridLookupRowValues(GridViewCustomBindingGetRowValuesArgs e) { var n = default(TKey); if (e.KeyValues.Count() == 0) { e.RowValues = new TModel[] { GetByKey(n) }; } else { e.RowValues = DB.Execute((db, w) => { var r = Query(w).Where(c => e.KeyValues.Contains(c.ID)).Select(CreateModelInstance); return(r.ToList()); }); } }