ICollectionView view = CollectionViewSource.GetDefaultView(GridProductInformation.DataContext); int supplierID = GetComboBoxSelectedItem(); //Predicate<object> pred = new Predicate<object>(MatchSupplier); Predicate<object> pred = delegate(object obj) { NorthwindProduct _product = new NorthwindProduct(); _product = obj as NorthwindProduct; int _supplierID = Convert.ToInt16(_product.SupplierID); if (_supplierID == supplierID) return true; else return false; }; view.Filter(pred);
view.Filter = pred;
_product = obj as NorthwindProduct;
obj
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)